1
Programming / Re: Smart AI vs Expensive AI
« on: June 23, 2014, 02:40:44 AM »
Are you looking to have anything other than reflex agents?
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.
random.sample() is a limited function, and it smacks to me of something someone put in to handle their own special case. The Python standard library has many of these sorts of things. There are arbitrary modules in there that almost do what I want, but are just unusable because whomever wrote them wanted them to work in a way that was unusable for me. Back to sample(), I've never had a sequence I needed to pick out a unique list of entries from. If I had to do this, it would be clearer IMO to write the code yourself than to call this function. Most of my random number usage was picking from weighted lists, and repicking was desirable. After all, you want 2x50 arrows sometimes, 1x50 arrows some other times, and so forth.
Do you really believe this is a realistic example? Or is it one contrived to employ random.sample()? To me, it seems like the latter. Is there anyone out there other than me that's written loot dropping code, who would write it this way or use random.sample()?
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.
random.sample(range(x), y)
A good precursor of that, "A game is just a database with a UI." Not to be thought of literally as database software.I don't know if I buy that quote. The database implies a model of the "nouns" of the game world, and some of the logical relationships, but doesn't tell the "story" so to speak. Your game should be more than just a UI.
I attended a presentation at Desert Code Camp on Saturday where the speaker used a great turn of phrase about databases, that the database is "your data at rest". In the application program, your data is "at work". The database should be where it's stored when the application has downtime.
Very often the RNG needs to be deterministic.
How so? I don't need that feature in my roguelike games.