Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sokol815

Pages: 1 2 [3] 4 5 6
31
Player's Plaza / Re: suggestions for a "thematic" RL?
« on: April 17, 2014, 04:30:43 PM »
Still looking for other suggestions, though. If I can't find a good fix, I might force myself to dust off my Python books. :D

That's pretty much my problem. No one rogue-like does exactly what I want it to do, so I am making my own. =) This probably also stems from the fact that I am a programming addict.

32
Programming / Re: Generating a list of unique random numbers
« on: April 14, 2014, 12:20:08 AM »
ah, the experiences of lists of random numbers. Javascript makes something like this super easy:

Code: [Select]
var numArr = Array(20);
for(var i = 0; i < numArr.length;i++){
   numArr[i] = i;
}
numArr.sort(function(){return Math.random()-.5;});
console.log(numArr);

It is impossible to randomly shuffle three values in a bounded number of coin tosses. Thus, this method either makes some permutations more probable than others or it uses an unbonded number of comparisons, depending on how "sort" works. For example, on my browser,
Code: [Select]
ile = Array(); for(t=0; t<1000000; t++) { arr = Array(1,2,3); arr.sort(function(){return Math.random()-.5;}); s=arr[0]+","+arr[1]+","+arr[2]; if(ile[s]) ile[s]++; else ile[s] = 1; } ilereturns 1,2,3 and 2,1,3 twice as frequently as other permutations.

EDIT: With 4 elements some permutations turn out to appear 180 times more frequently than others. Even if you look just at the first element: 1 and 2 appear with probability 28%, 3 with 18% and 4 with 25%. The probabilities of choosing each element seem out to be more and more different when the number of elements increased (with 17 elements, 1..17, they range from 3.5% for 6 to 15.8% for 1). If you wrote a game using this, it could be completely different on a different browser.

Yeah, that first code block is really not useful. maybe for prototyping something... If I needed to randomize an array, I would use the second method that I mentioned. Here is a test harnessed up to that 2nd method:
Code: [Select]
var ile = {};
for(var t = 0; t < 1000000; t++){
var arr = [1,2,3];
var arr2 = [];
var s;
while(arr.length > 0){
var index = (Math.random() * arr.length) >> 0;
arr2.push(arr[index]);
if(arr2.length == 1){
s = arr2[0];
} else {
s = s + "," + arr2[arr2.length-1];
}
arr.splice(index,1);
}
if(!ile[s]){
ile[s] = 1;
} else {
ile[s]++;
}
}
ile;

this method returns all 6 orders in similar proportions.
Code: [Select]
1,2,3: 166352
1,3,2: 166225
2,1,3: 166572
2,3,1: 166947
3,1,2: 166894
3,2,1: 167010

I use an implementation of a RC4 psuedo-random algorithm in my javascript games. it is called "Seedrandom.js". Seed random provides a seedable RNG. V8's built-in RNG is not seedable, so I use this instead.

33
Programming / Re: Generating a list of unique random numbers
« on: April 12, 2014, 04:01:37 AM »
ah, the experiences of lists of random numbers. Javascript makes something like this super easy:

Code: [Select]
var numArr = Array(20);
for(var i = 0; i < numArr.length;i++){
   numArr[i] = i;
}
numArr.sort(function(){return Math.random()-.5;});
console.log(numArr);
some outputs from the above code:
Code: [Select]
[15, 18, 10, 1, 7, 6, 9, 8, 4, 19, 11, 5, 12, 13, 14, 2, 3, 16, 17, 0]
[10, 17, 5, 15, 4, 9, 13, 1, 19, 11, 0, 12, 6, 2, 18, 14, 7, 3, 16, 8]
[19, 2, 3, 4, 5, 6, 8, 7, 13, 11, 0, 9, 1, 14, 15, 16, 17, 12, 10, 18]

the magic here is in the built-in javascript sort function. you can pass it random values and it will randomly sort all the elements.

another option that may be simpler for you (if you don't have an easy way to make sort be random) is to first initialize a new ordered array then create another array and pull from the first randomly and append to the second.
Code: [Select]
var arr = [0,1,2,3,4,5,6,7,8,9];
var endArr = [];
while(arr.length > 0){
     var loc = (Math.random() * arr.length) >> 0; //bitwise operator >> 0 does a shift 0 and gives an int. Math.random() returns a value between 0 and 1.
     endArr.push(arr[loc]); //add the picked element to the destination array.
     arr.splice(loc,1); //remove the just added element from the source array; arr.length is now 1 less.
}

the 2nd way is probably one of the easiest ways to do what you are proposing. Have fun!

34
Programming / Testing Mazing algorithms
« on: April 11, 2014, 03:11:35 PM »
Hey everyone! I have 2 different mazing algorithms that I am trying out.

Both of the below links take you to a page showing the maze being generated. The second has a restart maze option.

The first basically makes a random path until it hits a dead-end, then it will restart at the most recent terminus.
exilania.com/tests/maze1.html

The second starts a path then randomly switches to another path that branches from a random node on the currently generated paths.
exilania.com/tests/maze2.html

I think they both have their merits. What are your thoughts? I am leaning towards the 2nd algorithm because of all the false paths it will create.

Both mazes use a digger that has a rule where he can only move into a spot X from spot @ if a pattern is matched:

Code: [Select]
? = doesn't matter
# = wall
X = spot of interest (and is a wall)
@ = current spot
###
#X#
?@?

35
Design / need help designing your ascii interface? asciiflow.com
« on: April 09, 2014, 08:41:07 PM »
so, a coworker just showed me this website. It is intended as a flow-chart creator, but it actually works great for making menus and pictures and such.

I thought this was pretty neat, so I decided I would share it.

http://asciiflow.com/

the website has import and export functionality.

here is something I put together in about 30 seconds:

Code: [Select]
             +–––––––––––––––+         
+––––––––––––+roguelikes rock+–––––––––+
|            +–––––––––––––––+         |
|                                      |
|                                      |
|  a short treatise on why roguelikes  |
|  are the best thing since the games  |
|  began to exist...                   |
|                                      |
|                                      |
+––––––––––––––––––––––––––––––––––––––+

36
Design / Re: AutoTileGen - automatic tileset generator
« on: April 08, 2014, 03:50:41 PM »
Thanks for sharing that link.

I just supported the Auto TileGen campaign. It's a tool that I could write if I took about 100 hours to do so but... I probably only do about 50 hours of manual tile-design each year. So I think it makes sense to let someone else develop that software for me. Plus, supporting indie developers is a goal of mine.

Also, 50 Posts! Woot Priest status.

37
Design / Re: My two cents about Permadeath
« on: April 04, 2014, 10:52:10 PM »
my personal thoughts are that I am fine to save-scum, because then I actually have a chance at winning the game. But if I do win the game save-scumming, I don't count it as actually beating the game. I will go back and say "OK, now I need to do it without save-scumming".

In this instance, the save-scumming allows me to gain experience with the game without having to go to a stupid wiki to look everything up. If a wiki is the easiest way to learn something and I am stuck in a game that is probably what I will go look at.

My ideal game would be made in such a way that a wiki will not be very helpful in revealing all the secrets in a game, but playing it will tell you a lot more. This makes it so everything is dependent upon how the world is generated.

In theory, when a world is generated, a plot can be generated as well that is sophisticated enough to not just be repeats of an old plot, but shape the world in a completely different way. A detailed history of the world and a problem that evolves over that history could be the basis for a very promising game.

Repeating the same thing over and over is not something people love to do. Keep them engaged by novel beginnings that vary greatly from one game to another.

38
Programming / Re: I don't understand random seeds.
« on: April 04, 2014, 10:42:18 PM »
Woah, wait a minute. If you can play the same game twice, this means the game does not have permadeath. You can start over with exactly the same game world and if you make the same moves, the same sequence of events will occur. If you die, you can just repeat your game up to a safe number of turns earlier and continue as if nothing happened.

Obviously, this could be automated, but that wouldn't even be necessary in principle.

that would be if you used the same seeded dRNG for everything....

the way I do this is I create the world off of a seed (whether given or taken from the unix timestamp), then I go back and switch out the RNG with a random seed (unix timestamp)... this then leads to the ability to play the same world with a different in-game-playing seed.

I first use the above seeded dRNG to choose which races and creatures inhabit the world. I then go and reset the dRNG again to the same seed to actually generate the mainworld, and generate arrays of Seeds for each individual dungeon that should be generated.

Say I have 5 dungeons of depth 5, 20, 50, 100 and 40. now I have the main world generated, and I have 5 arrays of corresponding lengths with nothing but an integer seed in them.

When the PC goes to dive into one of those dungeons, the game will swap out the current RNG with the generate world RNG, reseed it with the appropriate generated seed for that level, and generate the dungeon level. It can then swap back to the RNG we were using before and populate the level.

That way you can play the same maps, but the items, danger rooms, enemies and all are different, which will allow your friend to say: "Lucky! I didn't get the dagger of dragon slaying on D3!"

39
Off-topic (Locked) / Re: 2048
« on: April 04, 2014, 07:57:15 PM »
sounds like the triple town/yeti town fiasco a couple of years ago.

The developers (Spry Fox) of triple town had the original idea, the yeti town "developers" (LOLAPPS Inc. and 6Waves LLC) just copied them.

Anyways... threes currently has about 10K - 50K installs on google play, 2048 clones all together have approximately 2000K - 10000K installs.

The only real difference between the two? Threes costs $1.99, 2048 is free.

it is interesting to see that the free app's total user base is approximately 200x the size of the paid-for apps user base. Imagine if they had released it for free and put ads on there.

for comparison: flappy bird had about 50000K installs...

There may be a good chance the threes developers would win if they took the other guys to court, but 2048 can be released by any guy who has the ability to checkout a git repository on github and package it into an android app.

40
Programming / Re: I don't understand random seeds.
« on: April 04, 2014, 07:43:19 PM »
I don't need a deterministic RNG. I need just a RNG.

Deterministic RNG's make it so much easier to reproduce errors/develop features (because then it is the same game every time you run with the same seed)
It also gives you a nice way to store dungeon levels.

The first thing I did when I started working on my javascript roguelike was to go out and find a deterministic rng algorithm and get it working.

Plus, you can ask the player if they want to play on a specific seed, so they can play the same game their friend is playing, and brag to them about how they are better at it!

It's never too late to take advantage of dRNG's, Krice!

41
Early Dev / Re: Browser Based Zombie wave survival Roguelike
« on: April 03, 2014, 04:41:53 AM »
OK, some more balance changes:
-PC has nowhere to hide.. no matter where you go, there are at least 2 directions zombies can come at you from.
-mystery box has a 36% chance to move to another spot when you activate it. (and you get nothing when that happens, just a refund!)
-Vivid heal changed to maxLife*0.15d2 (can upgrade to maxLife*0.2d2 upon serious usage)
-zombie's stats tweaked to make them a little different from each other. Consequently, lots of harder hits, now.

42
Early Dev / Re: Browser Based Zombie wave survival Roguelike
« on: April 02, 2014, 11:06:00 PM »

Huh.  Somehow I missed the "self" option.

I don't like the idea of 1d(lifeMax*.3).  That's excessively unreliable for such an important effect.  (lifeMax*.15)d2 or a similar formula would at least ensure the player gets something in exchange for their turn and MP.

Self is the default target for the spell when no other target method is selected.

1d(lifeMax*.3) does seem a little more harsh than I would want to go for. seems to me that "(lifeMax*.15)d2" is a nice compensation between the two.

43
Early Dev / Re: Browser Based Zombie wave survival Roguelike
« on: April 02, 2014, 01:36:28 PM »
It's really easy to survive indefinitely.  Just leave one zombie alive at the end of each wave and run from it until your health and magic are full.  Then spam bayonet attacks and vivid touch (the only spell that matters) until there's one survivor so you can repeat the process.

good call. Also, you could just try "Self Vivid" that would be a little more efficient.

Good call with the waves lasting forever. I have fixed that now. A wave is capped out at about 100 turns, at which point the interim between the 2 waves starts. Good luck!

also, I might change vivid to instead do 1d(lifeMax*.3) healing instead of just lifeMax*.3

44
Design / Re: A piece-wise Magic System
« on: April 02, 2014, 06:59:02 AM »
FYI everyone, as posted on the early-dev board just moments ago:
http://forums.roguetemple.com/index.php?topic=4001.0

this system has now been implemented.
The PC starts with a few different known spell-pieces (8 right now) in the future, you will be able to learn them from books instead of just knowing them.
The spell creation system uses a linear increase in time for more pieces added and a quickly ramping up mana cost for more pieces added.
The PC is limited to what kind of spells they can understand by how much mysticism they have.

Check it out if you have a chance!

45
Early Dev / Re: Browser Based Zombie wave survival Roguelike
« on: April 02, 2014, 06:55:45 AM »
Well, I have gotten a ton of work done on this. Changes:
  • Spell Creation system implemented. just press t
  • Zombie kills now give you experience
  • Leveling up now occurs
  • Zombies have been made 2x as powerful
  • greatly lowered chances for strength increase

This game may actually pose a challenge now. The spell creation system ended up working out just like I wanted it to. Let me know if you have any suggestions on how to improve anything in here. (I know, I know... more spell pieces!)

Pages: 1 2 [3] 4 5 6