Jump to content
Leoo

Today...

Recommended Posts

your dungeon looks great. How are you drawing the game?  

 

Last 2d game I made was on a Java Swing Gui.

 

[hide]

 

b2cd1ce8aea3e6cc2550825d69b5a3a9.png

 

[/hide]

Share this post


Link to post
Share on other sites

I just use Pixi.js

 

I've written renderers before in vanilla js but it's just not worth the effort

  • Like 1

Share this post


Link to post
Share on other sites

You've inspired me to do proper random level generation in this game.

 

[hide]

 

b12e0597c1e594de8dcf7574fdc1bbec.png

 

[/hide]

currently working on setting up for the square dungeon rooms but can easily turn it into more smooth generation

Share this post


Link to post
Share on other sites

Nice that looks pretty cool. What are you planning on doing with it?

Share this post


Link to post
Share on other sites

probably just make a very basic game similar to the old school hand held zelda games and release the source code

 

[hide]

Using a log function to make grass and dirt much more common than stone now.

 

Tested it with this:

public class Play {

    public static int count = 100000;

    public static HashMap<Double, Integer> map = new HashMap<>();

    public static DecimalFormat decimalFormat = new DecimalFormat("#.##");

    public static void main(String[] args) {
        IntStream.range(0, count).forEach(i -> {
            double value = Math.floor(Math.log10(Random.nextInt(Integer.MAX_VALUE)));
            int count = map.containsKey(value) ? map.get(value) : 0;
            map.put(value, count + 1);
        });
        System.out.println(NumberFormat.getNumberInstance().format(count) + " Iterations");
        map.entrySet()
                .parallelStream()
                .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey()))
                .forEachOrdered(e -> System.out.println(e.getKey() + " -> " + e.getValue() + "(" + decimalFormat.format(getPercent(e.getValue(), count)) + "%)"));
    }

    public static double getPercent(int n, int div) {
        return ((double) n / div) * ((double) 100);
    }
}

24e41c7ea388e9e2e2ebdc774e2ea5cc.png

09940e2f6ba8335a4f2bf7835d874525.gif

[/hide]

Share this post


Link to post
Share on other sites

Wait, what does that code do? Looks like you're generating a number between 0 and 9 (assuming max value is 2^31) and calculating the percentage of each number

Share this post


Link to post
Share on other sites

Yeah so taking a number lets say 2.1B. you then put it in a log base 10 and you get out 9.3 and round down to 9.

 

So In that snippet im keeping track of how often I get a particular number to see how likely i am to get a particular one.

100,000 Iterations
4.0 -> 3(0%)
5.0 -> 36(0.04%)
6.0 -> 418(0.42%)
7.0 -> 4179(4.18%)
8.0 -> 41669(41.67%)
9.0 -> 53695(53.7%)

So I know how the odds will be distributed so I just use an ternary to switch the tile type based on if a random roll is mapped to less than 9 or less than 8, etc.

 

 

edit: that snippet isn't running in the game I just used it to see if log function was good for weighted distributions

Share this post


Link to post
Share on other sites

The probability of rolling n in 1..8 is 10^n * 9 / 2.1b. When n = 0 it's 10/2.1b and when n = 9 it's 1.1b/2.1b.

 

So 

0:  4.6566128730773926e-9
1:  0.000004190951585769653%
2:  0.00004190951585769653%
3:  0.00041909515857696533%
4:  0.004190951585769653%
5:  0.04190951585769653%
6:  0.41909515857696533%
7:  4.190951585769653%
8:  41.90951585769653%
9:  52.38095238095239%

Btw a good function to weight your distribution to the high end is sqrt. In your case, generate a number between 0 and 100, then take the sqrt of it

  • Like 1

Share this post


Link to post
Share on other sites

Was abroad for a day again.

 

BTW, Estonians beat Canada 16-4. In floorball, which is hockey, but on a hardfloor and with a ball. Shame!


t3aGt.png

 

So I've noticed this thread's regulars all follow similar trends.

 

RPG is constantly dealing with psycho exes.

Muggi reminds us of the joys of polygamy.

Saq is totally oblivious to how much chicks dig him.

I strike out every other week.

Kalphite wages a war against the friend zone.

Randox pretty much stays rational.

Etc, etc

 

Share this post


Link to post
Share on other sites

Was abroad for a day again.

 

BTW, Estonians beat Canada 16-4. In floorball, which is hockey, but on a hardfloor and with a ball. Shame!

So like field hockey?

 

 

Nice, on your way to redoing the dg skill huh?


"Fight for what you believe in, and believe in what you're fighting for." Can games be art?

---

 

 

cWCZMZO.png

l1M6sfb.png

My blog here if you want to check out my Times articles and other writings! I always appreciate comments/feedback.

Share this post


Link to post
Share on other sites

Ran into my ex's neighbor last night. I've had a tiny crush on this girl for years now, but it never went anywhere because who knows. Anyway, hadn't seen her in about 2 years or so. Bumped into her last night as i was leaving. She told me how much i've changed and hiw much different i look from the last time she saw me. Now she seems really keen on getting together before i leave for Greece in a few days. When it rains it pours. 

Share this post


Link to post
Share on other sites

Lol I have a memory leak

 

how the [bleep] do you debug a memory leak in javascript ???

 

I have relied on garbage collectors for too long

 

nvm I figured it out 5 minutes later. I was adding everything to the stage and the stage held onto the references of every sprite I created so the GC never removed them. Now I just clear the stage every frame and I use like no memory

  • Like 2

Share this post


Link to post
Share on other sites

I had a memory leak recently and used Valgrind to track it down.

 

My program analyzes gigabytes of data, and small test cases didn't leak. Running it through Valgrind took forever. But after I reviewed the log, it was trivial to fix the leaks.


ozXHe7P.png

Share this post


Link to post
Share on other sites

 

Was abroad for a day again.

 

BTW, Estonians beat Canada 16-4. In floorball, which is hockey, but on a hardfloor and with a ball. Shame!

So like field hockey?

 

Not really. Field hockey is on a grass field with a rubber ball and borders like on football, floorball is played in a rink. Sticks and balls are both super light and have holes in them to be more aerodynamic.


t3aGt.png

 

So I've noticed this thread's regulars all follow similar trends.

 

RPG is constantly dealing with psycho exes.

Muggi reminds us of the joys of polygamy.

Saq is totally oblivious to how much chicks dig him.

I strike out every other week.

Kalphite wages a war against the friend zone.

Randox pretty much stays rational.

Etc, etc

 

Share this post


Link to post
Share on other sites

Traveling to Greece tomorrow, for a week. Excited to get away from home for a bit, but not too happy that it's in December. It's going to be so damn cold. I remember going in November-ish last year and the cold was pretty much unbar able for me. 

Share this post


Link to post
Share on other sites

What is it, like 15 degrees Celsius there?

 

That's our summer.


t3aGt.png

 

So I've noticed this thread's regulars all follow similar trends.

 

RPG is constantly dealing with psycho exes.

Muggi reminds us of the joys of polygamy.

Saq is totally oblivious to how much chicks dig him.

I strike out every other week.

Kalphite wages a war against the friend zone.

Randox pretty much stays rational.

Etc, etc

 

Share this post


Link to post
Share on other sites

Its like 20 Celsius here in winter. In fact I've been wearing shorts :lol: 

Share this post


Link to post
Share on other sites

We've had it get down into the 40s at night. I love opening my window at night in this kind of weather. So nice

Share this post


Link to post
Share on other sites

What is it, like 15 degrees Celsius there?

 

That's our summer.

When Estonia ever gets to 50 degrees in the summer, let me know. Till then, comparing your weather system/tolerance to mine is pretty much irrelevant. 

Share this post


Link to post
Share on other sites

 

 

What is it, like 15 degrees Celsius there?

 

That's our summer.

When Estonia ever gets to 50 degrees in the summer, let me know. Till then, comparing your weather system/tolerance to mine is pretty much irrelevant.

you should be aware by now, Estonians are utterly flawless

  • Like 1

Share this post


Link to post
Share on other sites

Woah Woah Woah, Estonian dude is actually from Estonia?

 

Gross.


Quote

 

Quote

Anyone who likes tacos is incapable of logic.

Anyone who likes logic is incapable of tacos.

 

PSA: SaqPrets is an Estonian Dude

Steam: NippleBeardTM

Origin: Brand_New_iPwn

Share this post


Link to post
Share on other sites

 

 

 

What is it, like 15 degrees Celsius there?

 

That's our summer.

When Estonia ever gets to 50 degrees in the summer, let me know. Till then, comparing your weather system/tolerance to mine is pretty much irrelevant.
you should be aware by now, Estonians are utterly flawless

Hey, this forum wouldn't be suitably diverse without the requisite Estonian nationalism.


polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

Share this post


Link to post
Share on other sites

Some butthead with an IP in India tried to access my primary email account which would have been awful because as my primary it has access to probably every password I've ever created. Fortunately my email provider was like "lol this guy isn't from India" and blocked the attempt. Mostly frustrating because I've gone almost 10 years without this issue, but less than 24 hours after my provider demanded I make my account more secure (and I changed my password just to make the notification I've had for months finally go away) an attempt is made to "hack" me. Obviously my shit was secure enough and then as soon as I comply with the demand to be more secure, I get attacked. Thanks Obama.


Quote

 

Quote

Anyone who likes tacos is incapable of logic.

Anyone who likes logic is incapable of tacos.

 

PSA: SaqPrets is an Estonian Dude

Steam: NippleBeardTM

Origin: Brand_New_iPwn

Share this post


Link to post
Share on other sites

Surely your likelihood of being attacked is independent of your password strength or whether you have 2 factor authentication.


My skin is finally getting soft
I'll scrub until the damn thing comes off

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.