### 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 - Gr3yling

Pages: 1 [2] 3 4 ... 12
16
##### Programming / Re: Generating a list of unique random numbers
« on: April 12, 2014, 05:11:38 PM »
Even though there is a built-in function, we might still want to understand how this can be implemented.  Learning this algorithm will help us apply apply a similar technique to solve other problems.

Thanks Jaxian.  Yep, that's exactly where I was going with this.  Although I do appreciate your input, requerent.

I think for the most part I understand what you guys are saying, and I'll try some of your suggestions.

EDIT: Oh, and maybe in about a decade I'll have a working prototype to share with you all.

17
##### Programming / Re: Generating a list of unique random numbers
« on: April 12, 2014, 04:35:41 AM »
the 2nd way is probably one of the easiest ways to do what you are proposing. Have fun!

Thanks for the suggestion, but I *don't* want to pull from one list to add to another.  I already found a way to do that (although it was probably much clumsier than the one you suggested).   And I forgot about using pop like Trystan suggested, that would have simplified the code that I posted.

It just seems "un-pythonic" that there is no way to go through precisely these steps: generate a random number, compare it to all the entries in a list, and then either append it or generate a new one.

Oh well, I guess it can't be done though.  It makes me feel better to know that there wasn't some obvious solution that I missed.  I appreciate the input from both of you.

18
##### Programming / Generating a list of unique random numbers
« on: April 12, 2014, 03:46:32 AM »
So, I've been trying to understand random dungeon generation, and have really gotten sidetracked on a tangent related to generating lists of random numbers.  It's driving me crazy, and I can't go forward with working on making an actual roguelike until I can resolve the questions I have.  Sorry if this question isn't as directly related to programming a roguelike as some of the others on this board, but I know you guys/girls and I think you are my best chance for getting an answer that I can understand.

I want to generate a list of unique random numbers in the following way:

1. generate a random number
2. check to see if it is already in the list
3. if not, append it
4. if so, chunk it and go back to step 2

I *don't* want to do something like this code that I wrote:

from random import randint

random_list = []

random_source_list = [i for i in range(10)]

print random_list

print random_source_list

while len(random_list) <= 9:
random_index = randint(0, len(random_source_list) - 1)
random_list.append(random_source_list[random_index])
random_source_list.remove(random_source_list[random_index])

print random_list

print random_source_list

It works, but I want to be able to accomplish my goal in the way that I stated previously.  Nor do I want to append a random number to the list, check for repeats, and then delete repeating numbers until I get a list of all uniques.  I already came up with a way to do it like that, but it just seems sloppy to me to use trial and error.  And I don't want to use classes either.

I realize these criteria must seem arbitrary, but this is something that I'm trying to figure out as a personal challenge, and it's about to drive me nuts.

19
##### Early Dev / Re: The Veins of the Earth development feedback v.0.12.0 beta 4)
« on: March 15, 2014, 04:40:18 PM »
Very cool Zireael.  It's good to see that you're back.  Keep up the good work!

20
##### Design / Re: Really, really basic libtcod question
« on: March 15, 2014, 04:37:44 PM »
Okay.  Thanks Quendus.  That was really helpful.

21
##### Design / Really, really basic libtcod question
« on: March 15, 2014, 02:07:40 AM »
EDIT:  Arrgh, I meant to post this in programming.  Sorry.

I'm trying to understand this code (which is from the roguebasin python + libtcod tutorial):

import libtcodpy as libtcod

#actual size of the window
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50

LIMIT_FPS = 20  #20 frames-per-second maximum

libtcod.console_set_custom_font('arial10x10.png', libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)

libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False)

libtcod.sys_set_fps(LIMIT_FPS)

while not libtcod.console_is_window_closed():

libtcod.console_set_default_foreground(0, libtcod.white)

libtcod.console_put_char(0, 1, 1, '@', libtcod.BKGND_NONE)

libtcod.console_flush()

If libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False) initializes the console, and libtcod.console_flush() displays the changes that I have made to it, why doesn't the console stay open in a script with just these two commands after libtcod.sys_set_fps(LIMIT_FPS)?  It looks almost like you have to use while not libtcod.console_is_window_closed(): to keep the console open, but I thought that line was essentially asking the question "is the console window open?" not giving python the command "keep the window open".  So, what is the bare minimum of commands necessary to keep the console window open and what the heck is the mechanism by which they work?

Is python looping through the commands after while not libtcod.console_is_window_closed():  LIMIT_FPS times per second, or does the console just stay drawn until it gets a command to change what it displays and is flushed?

Yes, I could ask this on the libtcod boards, but after a brief inspection of how complex the topics there are, I think I am too embarrassed to.

22
##### Design / Re: An old wild west roguelike? Ideas.
« on: March 08, 2014, 07:06:12 PM »
Right now I'm just trying to go through the roguebasin tutorial and comprehend the code.  I more or less understand what is going on up to the part on dungeon generation, so I'm maybe 10 to 20 percent of the way though the tutorial.

I think I'm a long way from being able to implement any features without the tutorial holding my hand, though.

23
##### Design / Re: An old wild west roguelike? Ideas.
« on: March 01, 2014, 05:23:12 PM »
So, guess who has an @ sign moving around a blank background now?

(Hint: it is not akeley)

I just copied the code from the roguebasin tutorial, but I still feel like it was quite an accomplishment, considering I had no idea what scripts were until a day ago.  I'm not even going to say how much I misunderstood what the tutorial was telling me to do to begin with, but lets just say I was pretty far off.

24
##### Design / Re: An old wild west roguelike? Ideas.
« on: February 22, 2014, 01:06:42 AM »
So, I finally finished the online python tutorial I was working on.  I'm sure that it would seem like very basic stuff to most of you guys, but I'm actually really proud of myself for getting through it.  It was quite challenging to me.  I'm hoping that now I can make some sense of the game making tutorial on roguebasin and start to create a very basic game.

Wish me luck.

25
##### Early Dev / Re: The Veins of the Earth development feedback 12/11/2013, v.0.11.0 beta 3.4)
« on: January 30, 2014, 09:55:02 AM »
We miss you, Zireael.  VoTE is really promising.  I know that school must be really tough for you, but please don't forget about VoTE.  Incursion needs a successor, and this could be it.  Don't give up!

26
##### Early Dev / Re: The Temple of Torment
« on: January 30, 2014, 09:51:52 AM »
I am also open for suggestions about game content and so on. I feel like there isn't enough content yet.

I'll check it out this weekend and try to give you some relevant feedback.

27
##### Early Dev / Re: The Temple of Torment
« on: January 21, 2014, 11:50:11 PM »
I did that inventory split to equipment and items. Works pretty good in my opinion.

-Sorcerer uses dagger in main hand and spellbook in off-hand. Spellbooks must be changed in hand if there is need to cast other spell.
-Sorcerer is able to use a sling.
-Fighter starts also with a javelin, which is reusable ranged weapon only for fighter. Must be picked up after throwing.

-Quest located in the world map. Maybe some cliche about clearing a bandit cave.

-3 endings, good, neutral and evil:
--good ending: killing the bad guys
--neutral ending: not sure about it
--evil ending: joining the bad guys

And some bad stuff: Due to a bug in libtcod I am unable to add any more graphics than about 60 to the game. I hope this will be enough for all upcoming features. I think so but sure it worries.

Sounds really cool.  Let us know when the next alpha is downloadable.

28
##### Early Dev / Re: The Temple of Torment
« on: January 20, 2014, 03:10:31 AM »
Fixed. I copypasted it wrong.

I've been playing alpha 3.  I like it.  The mechanics are solid and it is well balanced.

There are a couple of things I was wondering about, though.  Is there any way to allow players to choose bigger tiles if they want to?  It's kind of hard for me to see the 16x16 ones.  I couldn't tell if you were saying earlier that all tiles have to be 16x16 because of libtcod, so I understand if this isn't something that can be changed.

Also, have you though about adding a section separate from the rest of the inventory that just shows equipment slots and what the PC is wearing in them?  It can get kind of hard to tell what's what when there is a lot of stuff in the inventory.

Anyway, thanks for making a cool game.

29
##### Early Dev / Re: The Veins of the Earth development feedback 12/11/2013, v.0.11.0 beta 3.4)
« on: January 19, 2014, 12:54:27 AM »
I heard somebody won third place in the ToME module contest!  Congratulations, Zireael!

Just out of curiousity, what's the 20 page paper on?

Thanks!

It's the literature review for my MA (key words being hearing-impaired and language learning).
So far I have 4,5 pages

So.  Is the paper finished yet?  We're all eagerly anticipating a new version of VoTE.

30
##### Early Dev / Re: The Temple of Torment
« on: January 19, 2014, 12:31:30 AM »
So yeah. Third alpha released on website. Should be playable until end boss. End boss and two dragons in abyss not balanced and their loot not usable yet. Includes following updates:

Bugs
- saving now works as intented
- fixed bug where there was lag when entering any menu
- able to rest when hidden or friendly monsters are in field of view
- various fixes
- major bug involving Eilinmyr's summoned skeletons fixed

Keys
- Enter is now the general action key for pick item ',', talk 't', use 'u', next and previous level '<' and '>'
- inventory 'i' and drop item 'd' combined to multiple choice in 'i' inventory after selecting item
- vi keys are now usable
- look moved to 'x'
- debug keys disabled

Monsters
- new monsters

Locations
- half of Southern Marwal designed

General
- sorcerer disabled until designed
- ability to sell items in shop
- balances
- doors, opened by bumping

Quests
- quest reward for Eilinmyr quest

Looks really cool.  I'm going to try it later tonight.  I think this game has a lot of potential.

Pages: 1 [2] 3 4 ... 12