Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
klafbang
Nov 18, 2009
Clapping Larry
Have you considered not relying (100%) on a RNG but instead a randomly generated source of deterministic entropy? That way, you have much more control over which parts are correlated and which are not, and can represent all stats as a single ship identifier.

For example, generate a standard 128 bit UUID instead of a RNG seed. If you then use, say, bits 0-7 as a measurement of size, you could use bits 6-8 + 5 as a measurement of level of detail (a larger ship will then tend to have more level of detail, but there's a change a smaller one will have quite some as well). You can use some overlap for health, shield, …

This will also make versioning easier - instead of having multiple versions of your generator (which will suck once you get more than one to maintain), you can make your generator only use some bits depending on version (so new version functionality is disabled for old version ships).

If you need more values than can easily be encoded, you can use some bits as a RNG seed.

I used this approach to set up a collection of oracles. Each would have a UUID and would answer yes/no questions deterministically depending on this UUID. I would use individual bits of the UUID to give them personality (age, name, nationality, likes/dislikes, …). That way, I would always be able to seek out an oracle answering any questions in my desired way. Like the library of Babel (check out that middle part…), any question would be answered beforehand by some oracle and it would only be a matter of finding the right oracle (this one, for example, correctly predicted the results of the past 4 US presidential elections).

E: Update on bottom of previous page.

Adbot
ADBOT LOVES YOU

Nalesh
Jun 9, 2010

What did the grandma say to the frog?

Something racist, probably.
On the bright side, if you do hit a brick wall, most of these models actually looks like they'd be nice as a ksp part modpack.



Oh and:


Fish Noise
Jul 25, 2012

IT'S ME, BURROWS!

IT WAS ME ALL ALONG, BURROWS!
I've said it before but it bears repeating: this is the coolest.

Elentor posted:

This is made so that in the future, when given the option to upgrade your ship, you might see a cosmetic change in it. TheWhiteDragon suggested that there be also a way to keep the previous appearance, which I'm keeping in mind.
What are your thoughts on a campaign ship history or model viewer gallery the player can save ships to so they can return and appreciate their spaceships

Also tag yourself I"m Senior Thrust Truck

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS

klafbang posted:

Have you considered not relying (100%) on a RNG but instead a randomly generated source of deterministic entropy? That way, you have much more control over which parts are correlated and which are not, and can represent all stats as a single ship identifier.

For example, generate a standard 128 bit UUID instead of a RNG seed. If you then use, say, bits 0-7 as a measurement of size, you could use bits 6-8 + 5 as a measurement of level of detail (a larger ship will then tend to have more level of detail, but there's a change a smaller one will have quite some as well). You can use some overlap for health, shield, …

This will also make versioning easier - instead of having multiple versions of your generator (which will suck once you get more than one to maintain), you can make your generator only use some bits depending on version (so new version functionality is disabled for old version ships).

If you need more values than can easily be encoded, you can use some bits as a RNG seed.

I used this approach to set up a collection of oracles. Each would have a UUID and would answer yes/no questions deterministically depending on this UUID. I would use individual bits of the UUID to give them personality (age, name, nationality, likes/dislikes, …). That way, I would always be able to seek out an oracle answering any questions in my desired way. Like the library of Babel (check out that middle part…), any question would be answered beforehand by some oracle and it would only be a matter of finding the right oracle (this one, for example, correctly predicted the results of the past 4 US presidential elections).

E: Update on bottom of previous page.

drat you make a pretty great case with your example. I have two answers, basically:

1) Most of the RNG-reliant script is already structured, written and mapped on my brain, and even the current flaws are things I already have fixes for. I'd have to rewrite so much code that works.
2) I know my current implementation inside out. Okay, I'll probably eat those words the moment something bad happens :v: but I'm fairly happy with my current knowledge of my RNG - I've stress-tested it, wrote my own modifiers and extensions on the script, and the memory footprint is pretty low.

I will, however, start studying UUIDs since it does seem like it would make my life a lot easier in the long run. Who knows, maybe I'll even get to implement them on this project.

Nalesh posted:

On the bright side, if you do hit a brick wall, most of these models actually looks like they'd be nice as a ksp part modpack.

My go-to plan if I hit a brick wall is to sell the generator as a tool. But oh God just thinking of making an interface for it. :cry:


Fish Noise posted:

I've said it before but it bears repeating: this is the coolest.

What are your thoughts on a campaign ship history or model viewer gallery the player can save ships to so they can return and appreciate their spaceships

Also tag yourself I"m Senior Thrust Truck

Thanks!

That would be pretty neat. My current plans re: ship history:

Very Likely: Have some rare shops sell ships from your older hardcore runs.
Likely: My ModelGen supports themes, so have model variations of the same ship, possibly skins unlocked through the campaign.
Less likely: Using themes to add High-Def version of the models for eye-candy visualization purposes. This would be a massive undertaking.
Least likely but really cool: Have some shops sell ships from other players. This would require some network integration. I have some minor experience with it from my last freelance but still not confident enough. But who knows, it'd be a really cool feature.

A simple ship history visualizer would be relatively easy to do.

Elentor fucked around with this message at 01:04 on Sep 2, 2017

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Chapter 6 - Delving into RNGs


Before we go further, I'd like to dedicate a chapter to something I believe every gamer must have heard of at least once: RNG. Random Number Generator.

But Elentor, why?

If you're reading this thread, odds are that you've heard the term RNG a lot. Hell, there's a decent chance that you have a background in IT, Math, CS or some wizardry and already know a lot of stuff in this chapter. There's a chance you know more about this stuff than I do. But hopefully this chapter proves to be entertaining somewhat.

If you're on the other side of the spectrum and don't know what RNGs are at all, they're programs made with the purpose of yielding a "random" number. RNGs are heavily featured in almost every MMORPG. RNGs are heavily featured in almost every RPG. RNGs are featured heavily in almost every procedural game. Whenever you open a loot box, there's RNG behind it. Whenever you drop an item in your favorite Action RPG, whenever you hit a critical strike, whenever you generate a new world in Terraria, whenever a map is chosen for you to play in HOTS.

So, why not? I mean, there's not a lot of talk about how RNGs work. It's math-intensive stuff, but this is probably the one element that is shared between 2D games, 3D games, Action, RPG, FPS, Text-Based, you name it. And yet there are loads of misconceptions and very few people understand them, so this thread seems like a good excuse to talk about RNG, seeing as this game is going to be entirely reliant on them.

I don't claim to be an expert on RNGs, but I'll share what I know. Feel free to chime in with stories, anecdotes, knowledge and what not.


So what's the deal?

Because they're not truly random, most of the RNGs we deal with are actually Pseudorandom Number Generators (PRNGs). They have good statistical properties of random numbers, but they're not truly random. Think about it - how would you go around creating a random number generator?

The current RNGs that games use typically follow a sequence generated by an algorithm. Such algorithms may have varying degree of complexity, some are really simple and powerful, some are simple and bad, and some are extraordinarily complicated, heavy and bad. The algorithm needs an initial seed to get started. One of the ways to get a seed going would be to get the time of the day, for example (I believe that's what Diablo 1 did). Another way is to use a separate RNG to generate the seed and iterate on that RNG seed every time you open the program. You get the idea.

Either way, once started, these algorithms will yield a stream of numbers. This stream of numbers is (in most cases) always the same for any given starting seed.


How do RNGs work?

If you have no idea whatsoever how RNGs work, then this might break some of the magic for you. The most common type of RNG is called Linear Congruential Generator, and it's really simple: The next number is the current number modulo something. So you take a seed x and return x mod y. To spice things up, the current number receives some sort of operation (like x = 2x + 1) before the mod operation. That's it. Now you too know how to make a basic RNG that is bound to give headaches to thousands of people.

Wikipedia has a really good example showing how simple it is. In fact, I'll just link the wikipedia page for Linear Congruential Generators. You can take a look at it when you're bored - LCGs are the basis of a shitload of the current RNGs, so whenever you're angry at your loot in PUBG or how many times you failed at mining something in FFXIV, you can start shouting angrily at LCGs. :argh:

Now let's say you don't know jack poo poo about math and this all flew over your head. Still, just by seeing the aforementioned image, something must feel wrong. One of the example yields 3,6,3,6,3,6 indefinitely. That's a pretty lovely RNG. In fact, all of the given examples repeat after a while - this repetition is called the period of the RNG. Don't worry - modern RNGs have very high periods. They go from 2^32 to 2^(a few hundred thousands) which is a really big number. So you're not gonna see something like 3,6,3,6,3,6.

At least not directly.

For example, take a look at this little RNG:

x = (141*x + 3) mod 256

You can easily playtest it in Excel with the formula =MOD((A1*141+3);256). Initialize it with 1 on A1, paste it in A2, and have fun.

As the 256 hints, this formula will give you an 8-bit number ranging from 0 to 255, old-school Final Fantasy style. Other than the annoying fact that it always alternates between an odd and an even number (1, 144, 83, 186, 117, 116...) it has a period of 256 numbers, and each number occurs exactly once. Pretty neat, uh? However the period doesn't mean much, as we can see patterns of a frequency far lower than the period. Let's plot the output on a scatter graph in Excel:



Well I'll be damned, it's like staring at an Ulam Spiral all over again. You can see that this whole thing doesn't look very random at all. Every 8th number after 144 follows a straight diagonal line in steps of 8 - 144, 152, 160, 168. In fact, it's believed that featuring some sort of pattern is the case for most RNGs, and that you should always have a period far larger than the amount of numbers you're gonna use.

If you map every pair of numbers (1 with 2, 3 with 4) as X,Y coordinates on a 2D plane, you get this:



Holy poo poo. That definitely does not look random at all. In fact, you can play with the multiplier and the addition values of the LCG as much as you want. It's already mathematically proved that every pair of numbers is going to lie on a plane.

There are multiple properties that come out of this image. A bunch of them are related to predictability - that you can predict the next few numbers. These range from simple predictions ("You're not gonna have the same number twice in a row unless the RNG has a period of one or multiple internal states"), to broader predictions ("You cannot have x small numbers in a row because of the minimum distance between two pair points"), to complete and utter prediction of the exact same number. There are sites that do that for some algorithms.

Again, remember that most built-in RNGs everywhere are LCGs. To the point where the Wikipedia page starts with this quote:

quote:

Even today, caution is sometimes required, as illustrated by the following warning, which is given in the International Encyclopedia of Statistical Science (2010).[5]

The list of widely used generators that should be discarded is long ... Check the default PRNG of your favorite software and be ready to replace it if needed. This last recommendation has been made over and over again over the past 40 years. Perhaps amazingly, it remains as relevant today as it was 40 years ago.

He's not joking, by the way. I was using the official Random class from Microsoft's .NET when I ran into patterns that were visible in-game. So none of this is in the realm of the far-fetched, I had to deal with it in this very project and I'm still just starting it.

With that said, there are plenty of good RNGs out there. If well implemented, you're very unlikely to run into any issue whatsoever. Most of the time, RNG is going to look like this.



This should be good, though you should know that even this is not gonna be enough to satisfy some people. See, what is "random" is kinda philosophical. Maybe a huge streak of red in the middle of that image would make it more random, because after a bunch of clearly defined white noise we "understand" that the image is white noise, so is it truly random? To others, the self-limiting characteristics of LCG don't correspond to real world noise, which can even look less random than artificial noise because we expect randomness to behave in a way that is statistically likely.

But ultimately, we can't dance around philosophy, and "statistically likely" is where we start. Perhaps ironically, random really is "stuff that obeys certain probabilistic laws". The better they do at that, the more RNG tests they'll pass. After all, we're using these RNGs for real world applications, and getting the probability right matters a lot.


What are some of the common problems RNGs face?

The first problem I ran into was using .NET's System.Random. Every seed starts very similar. In fact, this seems to be the case to even the decent PRNGs like Mersenne Twister, to the point where a "warm-up" period is recommended where you skip the first numbers generated. So every ship had very similar stats to the ship with the next seed, and every star had stats similar to the ones around them, and so on.

This blog is pretty good. It explains some of the issues this guy ran into when using System.Random, kinda similar to mine. He experiments some, you might even recognize one of the patterns he runs into, and despair because the standard random class from Microsoft's .NET has the same pattern as the minimalistic RNG we toyed with earlier in this thread.

So that's the crux. Just being statistically accurate on the most basic level doesn't mean it's good RNG. We also need a good source of entropy. Without entropy, there's no point in having RNG at all.

For example, consider the following output:

000000000000000000000000000000111111111111111111111111111111111

While this output might seem hyperbolic, there are plenty of algorithms that at times can get stuck at bad states and output a bunch of zeroes. Now, this output has the following property: There are exactly 50% 0s and 50% 1s. And yet we know in our gut that it isn't good, because it isn't very random. I mean, it might be, this might be a sequence in a series of 2^300000 numbers that are otherwise perfectly random. But it sure doesn't have the properties we are interested in a random sequence.

So an RNG that outputs stuff like:

000111111000111000000111000000111111000111000111

Is also outputting 50% 0s and 50% 1s, but there's still a very strong pattern present in it: the numbers always come in trios. This is the kind of pattern that players will notice, but will be shut down because over time they're "statistically accurate" on the barest level. I'd say that this is the main point people miss about RNG. A good RNG implementation has a high degree of entropy. If you're playing something that yields you a negative (but statisticaly unlikely) output, such as:

0000010000000000010001100011000001010

And you calculate the odds of it being 1 in x, that's the same "1 in x" as every other sequence, but not the same as the other "1 in x" sequences with high degree of entropy. And yes, the size of the sequence does count - some RNG algorithms fail statistical tests when the sample is small and that is seen as a weakness. So when you get:

1111011011111100111110111111101110011

You're getting something that evens out the first sequence, but that still lacks entropy. If you know that the system works like this, you can then assume (rightly so) that whichever sequence you're in is gonna have a higher than 50% chance of yielding 0 or 1 next. Worse yet, an RNG that presents low entropy, but only sometimes can be deceiving, because while the average entropy will be higher than the worst-case scenario, the worst-case scenarios will still be predictable by people who are paying attention.

Blizzard in general is one of those companies that understand RNG, perhaps too well for their own sake. Games like World of Warcraft feature very heavy systems that protect and prevent a player from having extraordinarily bad luck. This is because humans have a preference for stable systems like a sobol sequence, so a good RNG needs also to take human psychology into account.

Bad luck protection is also used a lot in loot boxes, to prevent players from having an extraordinarily bad streak. Just because something is statistically possible, doesn't mean it's good. It certainly isn't for people who run into long streaks without dropping an item they want, and so on, so companies may choose to tamper with the RNG and add weights that slowly but surely build up to 100% chance. Of course, having bad luck protection reduces the entropy of the system. So now you can see how the problem can get conceptually hard and you have to find a compromise somewhere.


So what of it?

Okay, so you've read this whole chapter. You feel nerdier inside. You deserve a treat.

Let's play a bit with System.Random. I wrote a script on Unity that will output a texture where each row corresponds to the first X states generated from Y axis used as a seed.



If this isn't art in the making, then I don't know what is. Look at these vertical lines. Yes, this will do nicely. Let's take the derivative of the Y axis.



I can almost see some tire patterns in it. We can make it better by wrapping values around.



Now this looks like a beautiful pattern, doesn't it?

Hell, I bet we can make a good texture out of it. Let's try to combine these textures to make some sort of low-poly space-station.



And with that, we conclude this update.


Links in this Chapter:
https://en.wikipedia.org/wiki/Linear_congruential_generator - Wikipedia page on LCGs, the most common basis for PRNGs.
http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf - Pretty nice article.
https://youtu.be/45Oet5qjlms - Melissa O'Neill's seminary about RNG in general and her own algorithm, PCG.
http://www.pcg-random.org - PCG's Official Site. It's the algorithm I'm using as of now.
https://blog.frogslayer.com/random-headaches-from-system-random/ - A developer's post about his issues with System.Random.
https://youtu.be/Yq2i6RDmbNc?t=187 - Bad luck protection (used by Riot Games on LoL).
https://www.youtube.com/watch?v=BVhRF6Jk6U8 - Bad luck protection (used by Blizzard on Hearthstone).
http://www.wowhead.com/news=260622/legion-developer-q-a-liveblog-for-february-2017 - Bad luck protection (used by Blizzard on World of Warcraft)

Additional Links:
https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d - PRNG is hosed up, who knew?
https://www.amazon.com/Art-Computer-Programming-Seminumerical-Algorithms/dp/0201896842 - A really good book about some of the original RNG techniques.
http://www.pcg-random.org/posts/visualizing-the-heart-of-some-prngs.html - Graphical representation of RNGs.
http://www.cs.ru.ac.za/research/g02c2954/Final%20Writeup.htm - Some more nice graphical representations of RNGs.
https://www.r-bloggers.com/pseudo-random-vs-random-numbers-in-r-2/ - This entire site is a collection of blog posts about RNG and statistical analysis.
https://www.random.org/ - Truly random numbers that are generated from atmospheric noise!
https://www.youtube.com/watch?v=SxP30euw3-0 - Someone going overkill and using radioactive substances to generate random numbers with a geiger counter. :v:


NEXT TIME:

Names! Mining terms! Spreadsheets!


Qs & As:

Not as much Qs as another great examples of games with messed up RNG. Real world examples!

Anticheese posted:

The Dominions 3 RNG quilt is infamous on these forums, and illustrates some serious clustering with the results. Add the fact that the game uses exploding dice (you roll again if you get the maximum result, repeat indefinitely) and you get the potential for the odd very improbable result.



After playing a bit with the image I reached this:



Lovely patterns, not so great RNG. Anticheese also was kind enough to provide a link to the code of said RNG.

On Warframe:

Fish Noise posted:

I was halfway through making a post about how it's been years and I forget the specifics and there was an image of what amounted to a goddamn bar code and so on, but it turns out the post about it was easier to find than I expected.
Says it hit mission rewards in particular, so it was causing a lot of definitely visible streaks.

Again, it's supposed to be fixed, but everyone who was around for it was left with a permanent sense of lingering suspicion.



Whenever you think "RNG is RNG", or "it's just random", please remember this image, and let it forever haunt your dreams.

A primer on Unity's very own blog:

https://blogs.unity3d.com/2015/01/07/a-primer-on-repeatable-random-numbers/ - A very interesting read!

Elentor fucked around with this message at 06:01 on Apr 26, 2020

TokyoHeadphones
Mar 18, 2014
I've always been curious to see how proc gen works, so thanks for writing all this!

RickVoid
Oct 21, 2010
I'm Commander Shepard, and this is my favorite thread on Comedy Internet Forums Something Awful Dot Com.

FractalSandwich
Apr 25, 2010
The stuff about bad luck protection is a bit of a distraction from the main thrust of the chapter, isn't it? I feel like you're conflating the way randomness is generated with the game systems that are built on top of that randomness, when those things don't have much to do with each other.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS

FractalSandwich posted:

The stuff about bad luck protection is a bit of a distraction from the main thrust of the chapter, isn't it? I feel like you're conflating the way randomness is generated with the game systems that are built on top of that randomness, when those things don't have much to do with each other.

They don't, but it's interesting to know all the elements behind the final RNG that is presented to the player. Like I said, most of the time you, the player, is just gonna see a bunch of noise even if the RNG is poorly implemented. There are many steps from the initial algorithm to the final product, bad luck protection is just one of those layers. At the end of the day the player will see the fruit of all of these layers. The raw RNG algorithm, the implementation of that algorithm, and the modifiers over that implementation to prevent bad streak.

Do you think I should have gone into more detail about it? Or separated better the low level from the high level stuff. The main thrust of the chapter indeed is the lower level stuff but I think it was worth the mention that it's not just the lower level stuff, and that it can be arbitrarily modified.

Elentor fucked around with this message at 08:35 on Sep 3, 2017

Anticheese
Feb 13, 2008

$60,000,000 sexbot
:rodimus:

The Dominions 3 RNG quilt is infamous on these forums, and illustrates some serious clustering with the results. Add the fact that the game uses exploding dice (you roll again if you get the maximum result, repeat indefinitely) and you get the potential for the odd very improbable result.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Man I had that on the tip of my tongue. I was asking about "that strategy game with really bad RNG" on IRC but no one could answer. Thanks a lot for reminding me of Dominions. I feel like one could make some beautiful fabric texture with that RNG.

Anticheese
Feb 13, 2008

$60,000,000 sexbot
:rodimus:

I was just thinking you could run it through a couple colour filters and get some kind of tartan. Do you have any insight into how the RNG got to be that bad?

EponymousMrYar
Jan 4, 2015

The enemy of my enemy is my enemy.

Elentor posted:

Do you think I should have gone into more detail about it? Or separated better the low level from the high level stuff. The main thrust of the chapter indeed is the lower level stuff but I think it was worth the mention that it's not just the lower level stuff, and that it can be arbitrarily modified.

One thing you should say more on is why entropy is important to the RNG. You mention it (and low/high entropy) but you don't cliffnote why it's important (or why high entropy is good and low entropy is bad.)

RNG protection totally deserves a spot though because a lot of procedural content games have a problem of leaning too heavily on the RNG, forgetting the lesson of Murphy's law (if something bad can happen, it will) and it's first corollary (just because something bad happened doesn't mean something worse won't.)

I spent 8 real life hours in FFXIV trying for an RNG drop once :suicide: (Atma farm in it's first iteration. Freaking Atma of the Ram.)
Good thing they learned from that!

FractalSandwich
Apr 25, 2010

Elentor posted:

They don't, but it's interesting to know all the elements behind the final RNG that is presented to the player. Like I said, most of the time you, the player, is just gonna see a bunch of noise even if the RNG is poorly implemented. There are many steps from the initial algorithm to the final product, bad luck protection is just one of those layers. At the end of the day the player will see the fruit of all of these layers. The raw RNG algorithm, the implementation of that algorithm, and the modifiers over that implementation to prevent bad streak.

Do you think I should have gone into more detail about it? Or separated better the low level from the high level stuff. The main thrust of the chapter indeed is the lower level stuff but I think it was worth the mention that it's not just the lower level stuff, and that it can be arbitrarily modified.
I think bad luck protection and other kinds of streak-breaking could easily be a chapter all on its own. I don't know how much of that you're expecting to do in your game, though, so I don't know how relevant it is.

Personally, I'd want to be really clear about the distinction either way. It's worth mentioning both aspects of it, by all means, and it's probably not actually confusing to anyone, but considering how poorly players understand the role of randomness in game design in general, and how people already say "RNG" as shorthand for any kind of random mechanic, I'd want to be sure.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS

FractalSandwich posted:

I think bad luck protection and other kinds of streak-breaking could easily be a chapter all on its own. I don't know how much of that you're expecting to do in your game, though, so I don't know how relevant it is.

Personally, I'd want to be really clear about the distinction either way. It's worth mentioning both aspects of it, by all means, and it's probably not actually confusing to anyone, but considering how poorly players understand the role of randomness in game design in general, and how people already say "RNG" as shorthand for any kind of random mechanic, I'd want to be sure.

Fair point. To be honest between bad luck protection and EponymousMrYar's point about entropy, I just felt like there was really a lot of stuff to cram into a chapter and I was unsure if people would want two chapters about this. I actually cut a lot of content that I wrote, including a chat about probability and intuition and a version of the Monty Hall problem with a Senior Thrust Truck behind the doors.


EponymousMrYar posted:

One thing you should say more on is why entropy is important to the RNG. You mention it (and low/high entropy) but you don't cliffnote why it's important (or why high entropy is good and low entropy is bad.)

RNG protection totally deserves a spot though because a lot of procedural content games have a problem of leaning too heavily on the RNG, forgetting the lesson of Murphy's law (if something bad can happen, it will) and it's first corollary (just because something bad happened doesn't mean something worse won't.)

I spent 8 real life hours in FFXIV trying for an RNG drop once :suicide: (Atma farm in it's first iteration. Freaking Atma of the Ram.)
Good thing they learned from that!

Yeah, pretty much every developer at some point mentions that if there's a chance in a million someone will get incredibly hosed, a few of those poor unfortunate souls will exist in a game with many millions of players, and it's gonna feel miserable for them.

I farmed those Atmas as well, my friend. I empathize with your pain.

Anticheese posted:

I was just thinking you could run it through a couple colour filters and get some kind of tartan. Do you have any insight into how the RNG got to be that bad?

Seeing as people already passed it through a FFT, I can do you something new: Perform some offsets on it. Here's a nice Tartan:





Pretty nice greebles :v:

No other RNG that I could find features those symmetries, so my guess would be a RNG with extremely low period with an internal state haphazardly hacked to cycle the variables after each period. I wonder what they were thinking back then - maybe cycle them through prime numbers? Cycle the dividend through two combinations of 16 prime numbers and suddenly you turn an 8-bit RNG into a 16-bit output. Here's an RNG I just wrote to test how that would look:



It's built on top of an 8-bit RNG though, but it presents sort of similar, zoomed out properties, like the vertical black lines surrounded by vertical dots on both sides. To be honest, I'm likely as curious about the Doms 3 properties as you are. poo poo, if I knew its formula I would unironically use it to produce greeble textures.

Elentor fucked around with this message at 10:58 on Sep 3, 2017

Anticheese
Feb 13, 2008

$60,000,000 sexbot
:rodimus:

Elentor posted:

To be honest, I'm likely as curious about the Doms 3 properties as you are. poo poo, if I knew its formula I would unironically use it to produce greeble textures.

I did a little bit of googling, and supposedly this is the decompiled code to the RNG. It's late at night and I'm not used to parsing obfuscuated code, but maybe this could help you with creating greeble? :shobon:

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Oh that's neat, thanks a lot! I'll play around with it.

Anticheese
Feb 13, 2008

$60,000,000 sexbot
:rodimus:

I look forward to seeing what comes out of it! Supposedly, for those playing at home, it works by iterating through an array of predetermined variables, incrementing another, and XORing the "random" product with some other data or somesuch. Either way, with 500 "seeds," regular increments, and a predictable operation, that would explain the cross-hatching. Compsci should not be attempted when you're mega tired, but drat if it isn't interesting taking a peek behind a fascinating game.

Thanks for digging into this, Elentor. I look forward to seeing what you come up with. :sun:

Xerophyte
Mar 17, 2008

This space intentionally left blank

Elentor posted:

Let's play a bit with System.Random. I wrote a script on Unity that will output a texture where each row corresponds to the first X states generated from Y axis used as a seed.



If this isn't art in the making, then I don't know what is. Look at these vertical lines. Yes, this will do nicely. Let's take the derivative of the Y axis.



I can almost see some tire patterns in it. We can make it better by wrapping values around.



Now this looks like a beautiful pattern, doesn't it?

Hell, I bet we can make a good texture out of it. Let's try to combine these textures to make some sort of low-poly space-station.



And with that, we conclude this update.

I'm kind of amazed at how well that worked out. You're basically (ab)using the fact that the C# System library uses a poor lagged Fibonacci generator as a feature to get a texture with visible periodic structure. Neat! LFGs are typically not very good generators, so patterns appearing when you start doing cuts through the sample space isn't terribly surprising.

I've done some work with procedural texturing (I worked on the procedural wood model that's used to render this thing, for instance) and I would probably have taken a completely different tack to generate a space station-y texture. Subdivide the height dimension into floors, texture each floor with some combination of rectangular tiles and manhattan distance voronoi cells, maybe? Anyhoo, the entire differential-Fibonacci-modulo approach is elegant and a lot less work. It can probably be generalized to produce similar patterns with any Fibbonacci-like sequence, not just whatever C#'s System::random does.


On RNGs, there's a distinction between state and entropy. An RNG with more state has a larger period (or can have, at least). An RNG with more entropy is harder to predict.

I'd say that in graphics you typically don't care about entropy. Usually the requirements for noise in graphics are the exact opposite of crypto: you want a predictable output that can be easily reproduced. Using hashes and fixed sequences with no entropy whatsoever is the norm. Noise quality is important in the sense that your noise should keep the spectrum expected for its class (white noise, blue noise, etc) for any subsequence of noise values you use, such as for each row in a white noise texture. You can get that with a well-formed (and much cheaper) hash function. In either case, I definitely suggest avoiding anything platform specific like System::random or /dev/urandom that doesn't guarantee a specific implementation. That way lies nondeterminism and pain.

If you do need an RNG then you still don't need a ton of entropy as such. You need enough bits of state that the inherent periodicity of any RNG doesn't become obvious and an algorithm that makes good use of those bits. Dom3's sounds-kinda-XORShift thing has neither, the Knuth-based LFG apparently used C# probably has more state* but is pretty bad at using it. Still, there's no particular need for the RNG to entropy-preserving like Blum Blum Shub (yes, that's an actual RNG type). You'll note that the other guy used a Marsenne Twister, which is easy to predict and doesn't preserve entropy but does have a well-researched distribution and is known to not have obvious correlations for a range of sampling patterns.

* The C# docs don't specify the exact implementation of System::random so I don't know how lagged it is, but they do say that initialization is expensive which indicates that they're doing at least some of the priming required for an LFG with decent state.


E: I was bored, so I tried to prototype a procedural texture that uses a hierarchy of tiles and Voronoi cells on shadertoy. Needs a lot more work to combine them to something remotely good looking but it has a vague vehicle camouflage-ish pattern at least.

Xerophyte fucked around with this message at 05:46 on Sep 4, 2017

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS

Xerophyte posted:

I've done some work with procedural texturing (I worked on the procedural wood model that's used to render this thing, for instance) and I would probably have taken a completely different tack to generate a space station-y texture. Subdivide the height dimension into floors, texture each floor with some combination of rectangular tiles and manhattan distance voronoi cells, maybe? Anyhoo, the entire differential-Fibonacci-modulo approach is elegant and a lot less work. It can probably be generalized to produce similar patterns with any Fibbonacci-like sequence, not just whatever C#'s System::random does.

drat, that's a fantastic wooden texture and the whole thing looks very realistic.

Re: Voronoi, I use Perlin and Voronoi a lot, so I've been trying to think outside the box lately. My "default" spaceship texture is a filter I made a while ago based on an older, uglier snippet of mine that I'm 99% sure is used all over Star Wars Rebels. Not that it is a novel technique, they probably came up with it by themselves as well because it's pretty obvious.



I haven't got to it yet but there'll probably be more than one chapter dedicated to Procedural Texturing, where we'll be exchanging ideas and techniques. Right now I'm trying to catch up on where I am dev-wise, which should happen next chapter. Afterwards the LP will be mostly be in real time and the moment I get to texturing we'll talk a lot about noise. :v:

Xerophyte
Mar 17, 2008

This space intentionally left blank

Elentor posted:

drat, that's a fantastic wooden texture and the whole thing looks very realistic.

Re: Voronoi, I use Perlin and Voronoi a lot, so I've been trying to think outside the box lately. My "default" spaceship texture is a filter I made a while ago based on an older, uglier snippet of mine that I'm 99% sure is used all over Star Wars Rebels. Not that it is a novel technique, they probably came up with it by themselves as well because it's pretty obvious.

Something like this, I guess?

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
That's a really nice implementation! I hadn't considered writing it in shader form. Shadertoy looks like a lot of fun to play with. Saw your other shader - your code is really neat and clean. I'm a huge fan of shader wizardry.

Fish Noise
Jul 25, 2012

IT'S ME, BURROWS!

IT WAS ME ALL ALONG, BURROWS!
This image is basically why no one will ever fully trust Warframe's RNG ever again, even though it's supposed to have been fixed years ago.

FractalSandwich
Apr 25, 2010

Fish Noise posted:

This image is basically why no one will ever fully trust Warframe's RNG ever again, even though it's supposed to have been fixed years ago.
What's the story behind that? Was it misbehaving in a way that was genuinely visible to players (seems very unlikely) or was it misbehaving in an abstract theoretical sense and people misunderstood what that meant?

FractalSandwich fucked around with this message at 10:45 on Sep 4, 2017

Fish Noise
Jul 25, 2012

IT'S ME, BURROWS!

IT WAS ME ALL ALONG, BURROWS!
I was halfway through making a post about how it's been years and I forget the specifics and there was an image of what amounted to a goddamn bar code and so on, but it turns out the post about it was easier to find than I expected.
Says it hit mission rewards in particular, so it was causing a lot of definitely visible streaks.

Again, it's supposed to be fixed, but everyone who was around for it was left with a permanent sense of lingering suspicion.

Nalesh
Jun 9, 2010

What did the grandma say to the frog?

Something racist, probably.

FractalSandwich posted:

What's the story behind that? Was it misbehaving in a way that was genuinely visible to players (seems very unlikely) or was it misbehaving in an abstract theoretical sense and people misunderstood what that meant?

It was genuinely bloody horrible, not sure it's better nowadays, now they just forget to add things to to the drop table for months :v:
Though it can still go on horrible streaks sometimes, like me farming for 9 hours total for a single part that'd average 1.5 hours(22.56%(so 77.44% chance of not getting it) chance every 20 minutes in a mission, which would be a 0.00100476453 chance of happening if I remember how to calculate this right? (.7744)^27)

Though Fish quoted the wrong horrible rng:

Nalesh fucked around with this message at 13:32 on Sep 4, 2017

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Chapter 7 - What is in a Name?


After I finished the Ship Generator I started looking at the ships and thinking: They need procedural names.

So how do I go around making procedural names? Well, the simplest way to do them is to make names like the rare items in Diablo. (Random Name) (Random Name). They probably have some more rules than that, but the idea is that you pick a list of nouns and mix with a different list of nouns. Maybe also make a list of adjectives.

So I started making a list of names. I wanted to make mining-related names first for the mining guild, so these probably had to include mining equipment, hauling terms, mining terms, stuff related to caves and quarries.



I'm not gonna show the entire list (not to spoil you), but it ended up being twice the count of 533 words shown here. I went and did some research on miners, mining culture, mining terms. I found out they have some wikis and dedicated online dictionaries which was pretty neat. Also, some of their gear looks amazing.

So after I tallied some 980 mining-related words and 200 (I believe) more general terms, I split them into groups. There are ten groups as of now:

General Groups - These will be shared with other factions. I'll be adding more stuff to them over time:
code:
Adjectives
Colors
Vehicles
Mining Guild:
code:
Adjectives
Agents
Fuel
Groups
Minerals
Vehicles
Weapons
The first thing I absolutely knew I wanted is that, regardless of the rules I used, I didn't want these names to occur at the same rate. I also wanted some of them to only occur as the first name or at least occur as the first name more often. They also needed tags for quick reference, so I could know regardless of the group if they were an attribute, an object, a random code, you get the gist.

Also, I wanted some names to be available more or less frequently depending on the exoticity of the ship. So I started making separate sheets for the names and manually adding values.

Example - Minerals spreadsheet:



I deliberately chose not to add any modifier based on level because I think over the long run that would make it pretty boring, and most endgame ships would be more or less the same.



This is the tab for quick analysis, so I could visualize what happens as exoticity goes up or down. Some names are gonna be rarer than others. I tried to input a different chance for most names so that they feel like they have their own weight to them.

Afterwards I started working on the script. I created a separate project as I wanted the NameGen to be general-purpose and began working on it. The first design decision was that the names wouldn't just be strings, instead they'll contain a lot of meta-data loaded from the spreadsheets so that I can create more or less coherent sentences.

So I created the File Importer, the Word Structure and filled in some test functions, like AddPossessive, FixPlurals (so a "s's" becomes a "s'"), AddArticle (a/an sensitive), Pluralize (sensitive to the word ending, but it can receive custom plural endings for irregular words from the spreadsheet), Sanity checks (not to pluralize if the word starts with an indefinite article) and so on.

This is the first batch of scripts generated for the Mining Guild:

quote:

Safe Mountaintop
Last Explosion
Pure Canyons Transporter
Firecreek
Stone Marine
Osmium Slope Digger
Lustrous Landgrinder
Boring Installation
Environmental Earth
Metal Career
Coal Welder
Diamond Explorer
Nice Colony
Dirty Miner

Xenomorph Group
Nickel Unloader
Account Misuse Finder
Water Miner
Efficient Rock
Traffic Development Roofbolter
Dirty Money
Money Hazard
Needless Thrusts
Solid Lot
Plagioclase Shear Technician
Unlimited Economics
Cerite League
Digging Hole Manager
Credit Demolition
Redhead
Organometallic Quay Machinist
Salty Concentration
Industrial Claims
Alluvial Drilling Barge
Electronegative Account
Brotherhood Minecart

Afterwards I added articles and other properties. This is the second batch, with more complex rules added:

quote:

----Exoticity 0----

The Crazy Chassis
A Logistic Misuse
Neolithic Quarry
Scooping Helper
The Construction Dirt Head
Economics' Ice Operator
Alluvial Money
Gold-biased Claims
Digmaster
The Sand-vein
Poor Mine Scraper
Narrowsite
Stellar Perfurator
Deep Thrust
Carbide-plated Geyser
A Fire Company Personnel
Cave of the Nickel Explorer
Argyrodite Grinder
Open-Punch Conveyor

----Exoticity 10----

Tar Battery
Canyon Hazard
The Needless Doodad Digger
Welder's Boring
Magnetite Bradawl
Dynamite of Platinum Person
The Mine Prospector
Flint's Cave
Freeminion
Confederation's Account Grader
Fossilized Machinery
Matrix Candidate
Metalloid-plated Supervisor
The Alien Creek
Moon's Boat
Salty Grind
Hole of Use


Man I'm not gonna lie, I was loving making this poo poo. The amount of effort into writing all the words and categorizing them was paying off big time. This stuff makes me happy to no end.

Anyway, I added a few more rules. For example, I added a character counter that reduced the weight of long words depending on the name size. Then I started adding code that would add assorted numbers and code to the names. For example, the name can have a prefix, generated by mixing differently weighted:

(ton, tonne, Ton, Tonne, -ton, -tonne, t, k, kt, T, KT, MT, lb, t)

- With a random number ranging from 1 to 10000, though it favors multiples of 10 and smaller numbers. So "1-ton Cobalt Helmet" is one of the possible outputs.

The script with the rules for generating Mining Names ended up being 508 lines long. After I got the names where I wanted them I tweaked the values to reduce some of the repetition. Because of the exoticity conditions, the pool for any given value is lower than the total pool if I used all names equally. Initially out of 100k names, 3% were repeated names. I managed to get that value down to 0.7% at exoticity 0 with 300k samples, which I find to be satisfactory for now since that number will go down as I add more names to the general purpose pools.

Here are 237 random names.
And here are 1000 more random names.


NEXT TIME:

Interface! Stage Selection! More Stage testing!

Elentor fucked around with this message at 13:57 on Sep 4, 2017

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
I'm probably going to have to come up with a procedural name generator to name the regions in my game, but in my case they'll need to have various alien-sounding names (like "Brinstar" and "Phendrana") rather than being collections of nouns and adjectives. So that'll be fun to think about.

Regarding RNG chat, it gave me an idea for how the player could learn to "manipulate" the RNG in-game. Let's say your enemies have random drops; make them only drop things on frames that also have some visual indicator, like their running lights are lit. So the visuals of cycling the running lights also correspond to the "randomness" (secretly not random at all) of whether or not something drops.

Obviously you wouldn't use something like that for situations where randomness mattered, but when you just need a reasonably even distribution in a single-player game (and are willing to accept advanced players breaking said distribution over their knees), you can get away with just having a cycle count-based determination.

FractalSandwich
Apr 25, 2010

Fish Noise posted:

I was halfway through making a post about how it's been years and I forget the specifics and there was an image of what amounted to a goddamn bar code and so on, but it turns out the post about it was easier to find than I expected.
Says it hit mission rewards in particular, so it was causing a lot of definitely visible streaks.

Again, it's supposed to be fixed, but everyone who was around for it was left with a permanent sense of lingering suspicion.
They don't go into as much detail as I'd like, and I don't know what they're actually trying to demonstrate with that graphic, or how they made it. What do they mean by "flipping a coin"? They can't be showing each generated bit one at a time, because that would mean the generator is either always returning the same value, or only returning either zero or the maximum value, depending on which way you read the graph. So are they only showing one bit from each generated word, or is it something else?

It certainly makes for a scary-looking visualisation, but I'm not convinced it's very meaningful, especially since they don't mention how much any given instance of the generator was being used, or how many systems and players it was being shared between.

Warbird
May 23, 2012

America's Favorite Dumbass

This thread is amazing and I don't understand any of it.

Red Minjo
Oct 20, 2010

Out of the houses, which is the most blue?

The answer might not be be obvious at first.

Gravy Boat 2k
Account Misuse Finder is an amazing name for a spaceship with guns attached to it holy poo poo. Gonna gently caress up everyone who used the company card for personal expenses.

RickVoid
Oct 21, 2010
So many great names on that initial list. Boring Installation, Metal Career, Nice Colony, and Dirty Miner are fantastic names for bored operators to name their rigs. Xenomorph Group is what some ore hauler named his tug in the hopes that it'll make pirates reconsider him. Dirty Money and Money Hazard are some rear end in a top hat executive's sick rides. Redhead is just great in general.

Red Minjo posted:

Account Misuse Finder is an amazing name for a spaceship with guns attached to it holy poo poo. Gonna gently caress up everyone who used the company card for personal expenses.

Violent Space Accountants, the adventures of Account Misuse Finder, Industrial Claims, and Credit Demolition aboard their starship The Unlimited Economics. It's the Anime we all deserve. (Number 9 on the 237 list is The Credit Caps! One letter off or we'd have a group name!)

A Salty Miner JY and Ludicrous Misuse 0 are loving killing me.

Fresh-Captain is super on the nose, holy poo poo.

RickVoid fucked around with this message at 20:30 on Sep 4, 2017

RickVoid
Oct 21, 2010
Hate to double post, but went through about half of the thousand list, these are really great:

Needless Candidate
Needless Planner
The Rock Dig
An Economic Trip
Dusty Dump
Propects Hole
Stable Hole
Large Barge B7
Poor Solution - The passive aggression in some of these is really great.
B744 Ice Technician
Account Excavator - Another one for the Space Accountants
Poor-Roadheader - BAHAHAHAHAHAHAHA It's line 283 if you don't fuckin' beleive me
Exhausted Excavator
The Detonation Society
J-E Misuses Money - The natural enemy of the Space Accountants.

There are more in the rest of the list, but I'll let someone else have a go.

RabidWeasel
Aug 4, 2007

Cultures thrive on their myths and legends...and snuggles!
I'd play Space Accountants Adventures.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS

TooMuchAbstraction posted:

I'm probably going to have to come up with a procedural name generator to name the regions in my game, but in my case they'll need to have various alien-sounding names (like "Brinstar" and "Phendrana") rather than being collections of nouns and adjectives. So that'll be fun to think about.

Regarding RNG chat, it gave me an idea for how the player could learn to "manipulate" the RNG in-game. Let's say your enemies have random drops; make them only drop things on frames that also have some visual indicator, like their running lights are lit. So the visuals of cycling the running lights also correspond to the "randomness" (secretly not random at all) of whether or not something drops.

Obviously you wouldn't use something like that for situations where randomness mattered, but when you just need a reasonably even distribution in a single-player game (and are willing to accept advanced players breaking said distribution over their knees), you can get away with just having a cycle count-based determination.

I'm considering doing the same for the stars, planets and regions though I haven't figured out how to make unique names and avoid repetition. UUIDs would probably provide an elegant solution for that if I were more familiar with them, I'm not sure. Something to make sure that the combination X, Y and Z didn't repeat across multiple stars, for example.


RickVoid posted:

So many great names on that initial list. Boring Installation, Metal Career, Nice Colony, and Dirty Miner are fantastic names for bored operators to name their rigs. Xenomorph Group is what some ore hauler named his tug in the hopes that it'll make pirates reconsider him. Dirty Money and Money Hazard are some rear end in a top hat executive's sick rides. Redhead is just great in general.


Violent Space Accountants, the adventures of Account Misuse Finder, Industrial Claims, and Credit Demolition aboard their starship The Unlimited Economics. It's the Anime we all deserve. (Number 9 on the 237 list is The Credit Caps! One letter off or we'd have a group name!)

A Salty Miner JY and Ludicrous Misuse 0 are loving killing me.

Fresh-Captain is super on the nose, holy poo poo.

Salty Miner is one of my favorites.

I can't wait to start working on some of the other factions. One of them has a pool of edgy/techno names. Pure blind combination yields "Agony Error", "Sulk Taker", "Pool Blazer", "Bland Machine", "Millenial Scowling".

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Elentor posted:

I'm considering doing the same for the stars, planets and regions though I haven't figured out how to make unique names and avoid repetition. UUIDs would probably provide an elegant solution for that if I were more familiar with them, I'm not sure. Something to make sure that the combination X, Y and Z didn't repeat across multiple stars, for example.

Unless you have tens of thousands of these things, just chuck all your names into a big ol' set or hashmap as you create them, and if you double up, slap a "New" on the front of the repeat's name. If you do have tens of thousands of them...maybe only generate them on an as-needed basis?

I don't think UUIDs will necessarily help unless there's a 1:1 mapping of UUID to generated name. Otherwise you'll just be in the situation where two UUIDs happen to map to the same name.

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Chapter 8 - Hub Interface


So as soon as I got that basic stage going I figured my next step would be making the hub between stages. As someone in the Making Games Megathread once said, nothing makes your game feel like a game as a titlescreen. Well this isn't a titlescreen, but it'll do.

Making the Hub GUI right now isn't absolutely necessary, but I felt like it'd be a huge step because since the stages are procedurally generated and have a bunch of stuff to debug, I could have a single menu giving me all the information I needed about the current stage progression as well as the current ship. Plus I'd be able to test the following loop:

Play a Stage -> Go back to Hub -> Select Next Stage

After each stage, sometimes you'd have access to a shop based on the settings of the stage you just completed (so if you're in territory of Faction X, you might find a shop selling goods exclusive to Faction X). One of the design decisions I had trouble was figuring whether the player >should< select the next stage before going back to the hub (which would make background calculations a lot easier because then I'd have to prebuffer the current stage + the next 3-4 selections only) or during the hub (so that you could choose a new stage anytime, but now I have to possibly prebuffer up to 16 stages). The latter ultimately seemed the more logical and fun decision at the cost of a potential loading screen, which is what I'm trying to avoid. Still, I stuck with it.

Okay friends, prepare for some more awful sketches. I warned you!



Right, so this is more or less what I had in mind. A central menu and some windows/cards/panels on the sides showing stuff. I also want panels to have separate tabs, though I haven't gotten around to do that yet,

Quadrant Panel:
Tab #1:
Shows an image of the planet/space/station of the area you're currently in. This is the stage that you just finished (and might be able to repeat). Shows some stats of the place, like population, faction, faction dominance, possibly available maps.
Tab #2:
Some backstory for the place, if the place contains any.
Tab #3:
Text related to the current campaign. Automatically shows whenever you complete a campaign stage.

Ship Panel:
Tab #1:
Shows a top-view image of your ship as well
Shows the basic stats of your ship
Tab #2:
Shows a top-view image of your ship with all projectiles being shot
Shows secondary stats of your ship
(EHP, Alpha Damage, Sustained DPS, Ship Range)
Tab #3:
Shows a side-ways rotating image of your ship
Fluff text about the ship's faction and class
//Possibly text about previous owners?
//Possibly text about ship mileage, kills, etc



The original idea for the stage select back when I thought stage selection would come between the stage and the hub. I eventually changed it.

I'm not a huge fan of making interfaces. Unity hasn't had a good history when it comes down to making designing GUI, though they've been improving in that regard.

The built-in Text Object is... not particularly good. For starters, the thing scales in fixed steps, which means text alignment changes depending not on the aspect ratio, but on the resolution even. I kid you not. Since I'm not using it anymore, here's an example from a text-based game demo I wrote a while back:



Same setup, same aspect ratio, different resolutions. Sometimes the amount of lines change as well. It's a mess.

So at some point, someone made an asset called TextMesh Pro that actually worked. It worked so well, in fact, that Unity hired him and now his asset is offered for free. Which is honestly a God-send!

I'm still not a huge fan of making GUIs but the current tools in Unity, once I figured them out and understood their rules, made things pretty enjoyable, surprisingly.



This is the first mockup I did in Unity. Panel placement is inverted from my original sketch but no matter. I thought it'd look ugly with just panel boxes, but I ended up liking the design!

So I got to this:

https://www.youtube.com/watch?v=2bzMsCJHqDM

I'm Tonites Spelunker.

Now this is looking much nicer. With this new visualization I could debug and fine-tune a bunch of stuff. The first thing I did was add a formula to normalize the ship sizes. Not normalize it entirely because that would be boring. I think finding a small/big ship should be part of the randomness. But I compressed the range somewhat so that players don't get ships that are too tiny or ships that are obscenely huge and unplayable.

I also added the first code re: Alternate color schemes. Ships can be Common, Uncommon, Rare or Shiny and these are just alternate color schemes for each faction. I haven't played around entirely with them yet, but this was as good time as any to implement the feature. The "Foil" status of the ship is independent of the seed. Currently they're set as 95%/4.1%/0.7%/0.2%.

Anyway, I made a Debug Stage that only lasted a few seconds. After a few more days of work, I got this:

https://www.youtube.com/watch?v=ZwASO8xL--o

This one has everything. It has a death conditional so that the game goes back to the hub when you die (and you lose any credits that you made in the stage). It has a win condition and a little victory screen.

So now I need to work on the stage select. I got a quick mockup going:



Not functional, but it's a start I want Stages to have traits (which will show under the "Mission" tag), like random map modifiers in Path of Exile, so that space is left blank for that. I haven't decided on the traits yet, but I'm considering stuff like "Stage is at Night" so your solar-powered gear won't be as useful, maybe wackier stuff.

Afterwards I worked on the internal stage generator. This took me a while, it's a bunch of internal logic that I had to rework. Eventually I implemented everything, tweaked positioning of elements a bit, and even added a little icon to show when the stage is hard:



And this is it. This is where I am right now. My current task is finding a way to populate these stages in a way that's interesting and good. This is (I believe) the biggest challenge as well as what makes the core gameplay loop good or bad, so it's where my focus is.


NEXT TIME:

Uncharted Waters!

Elentor fucked around with this message at 06:06 on Sep 5, 2017

Phrosphor
Feb 25, 2007

Urbanisation

I got such a Tyrian feel from that first sketch and some of the UI elements in the second demo video. Nice!

Anticheese
Feb 13, 2008

$60,000,000 sexbot
:rodimus:

Phrosphor posted:

I got such a Tyrian feel from that first sketch and some of the UI elements in the second demo video. Nice!

It's the rounded orange text over the tan background that does it. As a Tyrian fan, I'm pretty pumped with this.

The game prototype I was making in which I figured out rotation matrices for thruster trails used Tyrian sprites. :shobon:

Adbot
ADBOT LOVES YOU

Elentor
Dec 14, 2004

by Jeffrey of YOSPOS
Yeah the whole grimdark/desaturated aesthetic doesn't appeal to me. I'm not a huge fan of brown either but sci-fi is usually that dull grey or blue, so I think the warm color works well here. I might still brighten or saturate it more.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply