Dynadun [Platform-roguelike Prototype]

Show off your games, demos and other (playable) creations.
10$man
Citizen
Posts: 77
Joined: Sun Apr 22, 2012 10:40 pm

Re: Dynadun [Platform-roguelike Prototype]

Post by 10$man » Fri Aug 10, 2012 6:48 pm

This looks really good. I love that style of graphics as well.

User avatar
Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Dynadun [Platform-roguelike Prototype]

Post by Jasoco » Fri Aug 10, 2012 7:35 pm

bartbes wrote:
Jasoco wrote: Technically that's 2-bit. Black and white. Off and on.
You mean 1 bit, then?
Yeah. That's what I mean. Duh! I should have known that too seeing how obsessed with classic black and white Macs I was a decade ago.

It turns out the color palette I was talking about with black, white, red, green, blue, cyan, magenta and yellow was 3-bit color:
http://en.wikipedia.org/wiki/List_of_mo ... #3-bit_RGB
Example of a famous game that used it:
http://en.wikipedia.org/wiki/Jetpac

You should consider using this for the game. Give the game some depth while keeping the graphics beautifully simple. Basically color each tile/sprite a different of the 7 colors with transparency where the black would be. You wouldn't need to even color the images. Keep them white and use setColor to change to them. It would look neat. Even if you had it as a hidden option. (Use 3-Bit Color Mode)


Here's a reference for what bits mean for colors:
http://en.wikipedia.org/wiki/Color_depth

And a useful resource for figuring out which color palette to use to emulate different systems:
http://en.wikipedia.org/wiki/List_of_color_palettes
http://en.wikipedia.org/wiki/List_of_vi ... s_palettes

User avatar
Lafolie
Inner party member
Posts: 804
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Dynadun [Platform-roguelike Prototype]

Post by Lafolie » Sat Aug 11, 2012 4:08 am

As for the sharing feature, you should consider the ability to share things that are tailored by the player or uniquely discovered by a player. In your case you said you'd like random levels. So you could give the option store generated maps or even entire dungeons to share. This is a rather extensible idea and could cover some of the richness that you also mentioned.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

User avatar
dandruff
Prole
Posts: 38
Joined: Fri Jan 15, 2010 1:39 pm

Re: Dynadun [Platform-roguelike Prototype]

Post by dandruff » Sat Aug 11, 2012 4:20 pm

Time for a small update... I'm tinkering with the UI. What you see is Health-bar, Mana-bar, Food-bar and Exp-bar.
120811-001.png
120811-001.png (8.43 KiB) Viewed 1097 times
The ZX Spectrum colors are now used! (You're able to turn them of like proposed) Thanks Jasoco :)

The maps will be seed-based so that you're able to share them with friends if you would like that. A couple of questions regarding that though... Is lua's math.randomseed() consistent across platforms? And... do you think that the loot and stuff from the dungeons should be identical if using the same seeds, or should it be different although the dungeon itself looks identical?

@Lafolie
Do you have any examples on how you would share items or such? (I like the idea, but I'm having a hard time figuring out how to implement it.)

User avatar
Lafolie
Inner party member
Posts: 804
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Dynadun [Platform-roguelike Prototype]

Post by Lafolie » Sun Aug 12, 2012 4:02 am

There's a few ways to do it. You could seed the random number generator with a chosen (or random) number before map generation (like Minecraft), or you could save maps that are generated to files to share. As for the generation,there are plenty of ways to easily generate playable levels. Obviously there's complex ways to do it too, but there's no need unless you want high fidelity or to incorporate lots of mechanics.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.

User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Dynadun [Platform-roguelike Prototype]

Post by Inny » Mon Aug 13, 2012 11:26 pm

There's a wiki at http://roguebasin.roguelikedevelopment. ... /Main_Page that has a ton of articles on the design of roguelike games. The category on Maps should be of real help.

User avatar
Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Dynadun [Platform-roguelike Prototype]

Post by Jasoco » Mon Aug 13, 2012 11:40 pm

dandruff wrote:Time for a small update... I'm tinkering with the UI. What you see is Health-bar, Mana-bar, Food-bar and Exp-bar.
120811-001.png
The ZX Spectrum colors are now used! (You're able to turn them of like proposed) Thanks Jasoco :)

The maps will be seed-based so that you're able to share them with friends if you would like that. A couple of questions regarding that though... Is lua's math.randomseed() consistent across platforms? And... do you think that the loot and stuff from the dungeons should be identical if using the same seeds, or should it be different although the dungeon itself looks identical?

@Lafolie
Do you have any examples on how you would share items or such? (I like the idea, but I'm having a hard time figuring out how to implement it.)
That's awesome.

Also, I too was wondering about random seed and different platforms. If you have access to both Windows and OS X, use the following code to see if the numbers end up the same...

Code: Select all

math.randomseed(100)
for i=1,25 do
    print(math.random(1,10))
end
For me I get the following sequence on OS X:
1, 6, 5, 6, 3, 3, 9, 5, 3, 5, 2, 4, 9, 9, 4, 10, 6, 1, 2, 3, 9, 5, 3, 9, 8

User avatar
Nixola
Inner party member
Posts: 1940
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Dynadun [Platform-roguelike Prototype]

Post by Nixola » Mon Aug 13, 2012 11:44 pm

1, 1, 2, 6, 8, 4, 8, 1, 8, 2, 8, 10, 6, 6, 4, 4, 2, 1, 7, 3, 5, 3, 5, 2, 2, Win7 x86
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Dynadun [Platform-roguelike Prototype]

Post by Jasoco » Mon Aug 13, 2012 11:57 pm

Yeah. Just as I feared. This is why DOOM had "pseudo randomness" in that the "random" numbers were actually fixed and any time the game required a random value, it just picked the next one in sequence and looped around. This allowed two different computers to be more in sync.
http://doom.wikia.com/wiki/Pseudorandom ... _generator

How does Minecraft handle randomness with its generator? Does Java have a more predictable Random number generator across platforms? Since you can use a seed on any platform and always get the same world on Windows, OS X and Linux.

I think in a game this simple you could just pre-generate and hard-code a long list of random numbers and use the same method as DOOM used.

DOOM's code was something like this: (If I were to convert it to Lua)

Code: Select all

random_table = { 1, 6, 5, 6, 3, 3, 9, 5, 3, 5, 2, 4, 9, 9, 4, 10, 6, 1, 2, 3, 9, 5, 3, 9, 8 }
random_current = 1

function random()
  local r = random_table[random_current]
  random_current = (random_current + 1) % #random_table
  return r
end
To the end user it APPEARS random, but in reality is not.

Alternatively, if you're having a networked game that's only networked, you could have the server do the random number returning, but then A) you'd still be restricted to whatever platform the server is running on and B) you'd be requesting network data every time you need a random number. Then again, you could also have the server generate a random string of numbers at game initialization, have it send that string of numbers to each player and that way they'd all have the same numbers.

I dunno.

DOOM's random number generator:

Code: Select all

// Emacs style mode select   -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// $Log:$
//
// DESCRIPTION:
//	Random number LUT.
//
//-----------------------------------------------------------------------------

static const char rcsid[] = "$Id: m_random.c,v 1.1 1997/02/03 22:45:11 b1 Exp $";


//
// M_Random
// Returns a 0-255 number
//
unsigned char rndtable[256] = {
    0,   8, 109, 220, 222, 241, 149, 107,  75, 248, 254, 140,  16,  66 ,
    74,  21, 211,  47,  80, 242, 154,  27, 205, 128, 161,  89,  77,  36 ,
    95, 110,  85,  48, 212, 140, 211, 249,  22,  79, 200,  50,  28, 188 ,
    52, 140, 202, 120,  68, 145,  62,  70, 184, 190,  91, 197, 152, 224 ,
    149, 104,  25, 178, 252, 182, 202, 182, 141, 197,   4,  81, 181, 242 ,
    145,  42,  39, 227, 156, 198, 225, 193, 219,  93, 122, 175, 249,   0 ,
    175, 143,  70, 239,  46, 246, 163,  53, 163, 109, 168, 135,   2, 235 ,
    25,  92,  20, 145, 138,  77,  69, 166,  78, 176, 173, 212, 166, 113 ,
    94, 161,  41,  50, 239,  49, 111, 164,  70,  60,   2,  37, 171,  75 ,
    136, 156,  11,  56,  42, 146, 138, 229,  73, 146,  77,  61,  98, 196 ,
    135, 106,  63, 197, 195,  86,  96, 203, 113, 101, 170, 247, 181, 113 ,
    80, 250, 108,   7, 255, 237, 129, 226,  79, 107, 112, 166, 103, 241 ,
    24, 223, 239, 120, 198,  58,  60,  82, 128,   3, 184,  66, 143, 224 ,
    145, 224,  81, 206, 163,  45,  63,  90, 168, 114,  59,  33, 159,  95 ,
    28, 139, 123,  98, 125, 196,  15,  70, 194, 253,  54,  14, 109, 226 ,
    71,  17, 161,  93, 186,  87, 244, 138,  20,  52, 123, 251,  26,  36 ,
    17,  46,  52, 231, 232,  76,  31, 221,  84,  37, 216, 165, 212, 106 ,
    197, 242,  98,  43,  39, 175, 254, 145, 190,  84, 118, 222, 187, 136 ,
    120, 163, 236, 249
};

int	rndindex = 0;
int	prndindex = 0;

// Which one is deterministic?
int P_Random (void)
{
    prndindex = (prndindex+1)&0xff;
    return rndtable[prndindex];
}

int M_Random (void)
{
    rndindex = (rndindex+1)&0xff;
    return rndtable[rndindex];
}

void M_ClearRandom (void)
{
    rndindex = prndindex = 0;
}

User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Dynadun [Platform-roguelike Prototype]

Post by Inny » Tue Aug 14, 2012 4:08 am

math.random is a wrapper around the C standard library random function. However, the implementation of the function is platform specific, and each platform is different. We actually have a pure lua library that implements some randomizers: https://love2d.org/wiki/RandomLua. Given the same seed, they give the same results each time. That should be helpful.

As for something like Minecraft, with it's consistent world for a given seed, a similar thing is done. If you dig into the LD22 Minicraft source code for level generation, one of the first thing it does is grabs it's own instance of java's randomizer. No seed, but there's no sharing of randomizers, so it's theoretically possible that it could have a Seed feature. That's my best guess as to how Minecraft proper does it.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests