i’ve taken the liberty of editing the OP, with a new “section”, housing the threads you mentioned… hope it was what you were looking for!
@jonyon54 Just found an implementation of the Bresenham’s Line Algorithm for Lua (really do not want to get that much into this topic so I can code it myself ) and replaced my LOS_ONE function with it. After some adjustments it seems to work like a charm.
Thanks once more.
roguebasin is a treasure trove of code samples, and even full working samples of roguelikes… i have used it quite a bit for my python pet project…
@SteveAdamo Thanks! It’s perfect!
@voxel_pirate Nice, I’ll add it to the OP when I can!
EVERYONE:
CLICK THIS FOR THE LOVE OF PANDAS
It’s essentially a python AI Smackdown! Deadline for submissions is August 8 and if your ‘bot’ survives you’ll get a t-shirt.
Feel free to form teams here or in another thread if you like and tell all your stinking cave-basement nerd friends because hell yes all day long.
Let’s win it for the glory of Radiant
I just noticed there is also a monetary prize for winning. If we win that as a community we should donate it someplace. If an individual in the community wins it’s up to you.
Nice… but why does it have to be Python not Lua .
Because the universe hates us. xD
Having read the rules now, the focus is definitely more on the algorithm logic than the code. If we can figure out a fantastic algorithm in pseudocode, it shouldn’t be very difficult to adapt the sample to our alg.
I’m considering a trojan:
A ton of hunts to build rep and then slacks to gain more free food from people functioning off of my rep, followed by alternating hunt/slacks to keep rep high. I figure most people will assume hunt on +75% rep, and will then hunt for the bonus tribe food chance and the zero net that double hunting provides. Only every once in a while I will shaft them and gain a food.
-Bits
Seems interesting. Your idea has flaws however, the food change chart is as follows.
You | Them | Change
H | H | 0
H | S | -3
S | H | 1
S | S | -2
Therefore if the person you are with has a high rep value slacking is the better choice, with a random choice on their part slacking is always the better choice is you lose less if they slack and gain more if they hunt. The only way to not lose is for the other person to hunt, for example assuming rep is a straight chance to hunt (just as an example) then you’re food yields would be 3/2r-3/2 for hunt and 3/2r-1 for slack, so if they had an r of at least 2/3 then statistically you’d at least break even for slacking but they’d need an r of 1 to break even for hunting. In fact the main thing to make this complicated is the bonus food which I haven’t figured out how to properly account for. I’ll think on it some more but your strategy at least needs some work to account for their rep at the bare minimum.
while i do love Lua, Python is simply a much more widely used language…
Plus learning more languages is normally a good thing, and I’m sure there is at least one person other than me on here that can use python. The main problem is figuring out a strategy, we’ll have to account for everything from round number (1 is special), to figuring out how many hunts should be performed so as to maximise gain from bonus.
You are all right of course. It is good to learn more languages and Python is for sure more common… my motivation is just higher for everything related to Lua at the moment .
Two short questions to ensure that I understand the logic right of this challenge…
- 300(P-1) food means what exactly? Do not get why 300 is written prior the brackets and P is reduced by 1
.
- I understand that per round you will have more than 1 hunt (P-1), right?
Must be a culture thing as that’s basic algebra here, the number before the brackets means it’s being multiplied by them so 300*(P-1) as for why the P is reduced by 1 that’s just what they decided to do for starting food.
Yep, everyone will do (P-1) hunts every round, one with every other player still remaining. That totals to P(P-1) potential hunters across every hunt in a given round.
Thanks @Xavion! I was missing the asterisk… maybe too picky.
Someone should submit a “Mimic partners last choice” AI…that’s about as simple as it gets, but I think it might be effective.
I was reading up on game theory…wow, like a year ago almost? And heard about that AI beating out a ridiculous number of others in a “smackdown” like this. I think it was a prisoners dilemma style of game, that focused on passive vs aggressive vs reactive style AI’s…I think that I’m remembering that correctly.
Although to be fair…it could be that none of what I just said is true, I admit I am as new as it gets to any of this
i’ve been spending what little free time i have lately pruning my little roguelike (all in python, and based on some articles from roguebasin)… it really is an awfully productive language to use…
Hi Everyone!
But m Xavion, m. Also the idea that only slack is going to be an extremely common build I would think. Your biggest boons will be from m and I don’t think I’m going to be the only one to be doing statistics on that. And of course I’ll be doing stats on their rep, I was just covering the core of the idea.
To account for m:
Likely chance of bonus food required to even bother factoring it in, or higher, weight toward hunt, if not, weight toward slack:
m = a subset of P(P-1), the number of players required to hunt a certain number of times for bonus food.
R = the mean of all reps last round
P = the number of players
if RP(P-1) <= m then:
weight more toward toward slack
110 players, .67 average rep, m = 7314
if (.67 * 110)(109) <= 7314
if 8033.3 <= 7314; # in this case we weight toward brohunts, bro.
xD
I have that exact same food change chart on a notepad at my desk.
@voxel_pirate Xavion is correct on the food, P-1 is just to keep you on your toes. There’s some mathematical significance of it to certain builds, but yeah.
@cablex17 I don’t actually think we get a list of actual actions, just rep (and upon closer inpection, hunt outcomes, which will be integers ranging from -3 to +1), so a mimic would be difficult depending on how many significant digits they give us on rep (you could glean their choice from the tiny rep changes), or based on trying to associate specific hunts with specific algs (they’re all randomized in the rep table every round)
Honestly it may be statistically viable to do an all-hunt. Ahhh math.
EDIT: m is a subset of P(P-1), not P. Whoooooooooo!
Didn’t know where else to post this so i’ll put it here.
Could any people with OOP/Python knowledge help me with my following problem?
So, I want to make a text based and eventually 2D turn-based city-building game. I won’t go into detail though.
The problem is: How would I make new villagers be born with the attributes of name, personality, age, gender, etc, without having to type in a variable for each villager and without a limit?
TL;DR - I need a class that can make infinite objects.
off the top of my head, and very generically, you could create lists representing things like names (or even pieces of names), personality types, etc., and then when generating new characters, you dynamically create them from randomized items culled from those lists…
edit: i need to head to bed, so perhaps someone will offer some more meaningful advice… failing that, i’ll try and provide something more helpful in the AM…
So you need a class to represent a villager? And that list of attributes is kind of problematic in that it’s varied enough a general solution as they’d all be represented differently from numbers, to strings, to whatever personality would be. As a rough guide though and pretty similar to what @SteveAdamo said here goes
class Villager:
def __init__(self):
self.name = get_name()
self.age = get_age()
self.gender = get_gender()
self.personality = get_personality()
self.whatever = get_whatever()
The basic layout would be something like that so to add another attribute you’d just add another thing to the list and make it’s generator function. If you gave more information like details on what the attributes like personality would be or your skill with python or what kind of things you’d want the generators to do I could be more help but as is that’s pretty much the best I can do.
So wait, if there will be less hunts then needed to make m favor slack and if the will be extra hunts favor hunts? Wouldn’t the second one mean you can manage less hunts for bonus and vice versa? Remember to assume everyone is at least as sneaky as you when you’re planning, it’s a pity we can’t get everyone to just run optimal survival strategy really. What about edge cases like round one? would hunt or slack be your preferred choice as they can’t make any assumptions at the point so it’s an interesting edge case.
I anything I assume everyone will act like you, and be sneakier than I will, thus I will hunt to try and get the bonus for everyone. That’s more of an extension of my personality than based on math. I was just showing a simple way to account for m.
@theEPiK1: Erm, That’s so vague. Christ. I’ll do my best to answer it this weekend, when I have like a couple hours.