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 - CrowdedTrousers

Pages: [1]
1
Design / Re: DawnLike - 16x16 Roguelike Tileset
« on: February 13, 2014, 07:16:17 AM »
Fantastic tileset.  Very impressive.

2
Design / Re: Spellcaster AI design
« on: January 31, 2014, 10:41:44 PM »
thanks for the feedback guys, and sorry your OP has been hijacked, Aukustus!!

So I think you're both still not quite hitting my issue.  The problem is not so much in the attack functions themselves, but calling them in an abstract way.  A monster's AI goes like this

  • attack = highest rated  token in my attack_list
  • attack.attack_function(args)

So the problem is that when I call an attack function, I have no idea what you're calling.  Is it throw() which requires (attacker, target, item); or is it punch() which requires (attacker,target)?  How do I stack out an argument list when I don't know the function I'm calling? 

So there seems to be two options - either pass every possible attribute and let the function work it out (shudder - probably huge considering all attacks) or have a massive case statement for each argument possibility (also huge for same reason).  Neither appeal to me.



3
Programming / Re: Where to start?
« on: January 31, 2014, 10:30:59 PM »
I had aspirations for a long while, but I hadn't programmed in anger since Uni.  Late last year I stumbled across Jotaf's python tutorial (the one Aukustus links to).  Within four-ish days I had it up and going and enough of a handle on Python that I was adding my own content and mechanisms.  I find Python easy to prototype in so I can rapidly implement ideas and see what they looked like.  Now my project is almost un-recognisable from the tutorial.

4
Design / Re: Spellcaster AI design
« on: January 30, 2014, 09:17:46 PM »
That sounds similar to how I've been doing things. Is there a playable version or source code somewhere?

My code is spawling, poorly documented and in Python. I do have a build but I'm not ready to post it just yet. I'll try to explain it better...

In essence each monster has an attack_list of a class I've called called 'attack tokens'. Each token has attributes of name, range, value and function.  The value is the attack's weighting (higher values mean better attack), the function is a reference of the function to call if this attack is ever used.  Each monster keeps track of the highest valued attack in it's list, which will also give it the range it needs to be. When I process monster AI, and determine something wants to be violent, I check to see if its target is within range of its highest valued attack token - if not move closer, if in range I execute the function referred to in the attack token.

The key is to write attack functions that can be used in this way. Abstracting the attacks from the monster AI gives me lots of flexibility. I can add any kind of attack to any monster, and I'm working on tying this to the items as well - picking up a wand of cold will add a high-valued medium-range cold-ray attack token to a creature's attack_list.

A problem I have with this method is to be interchangeable at run time, all attack functions must have the same arguments.  So far I have standardised down to two -> passing reference to attacker and target.  There are times I want to pass more, but haven't worked out how to abstract that into the attack_token yet.

I've also been musing on incorporating detection conditions as well (which will push this even closer towards state machine, which it was based on initially). So I think that the attack tokens could also have a list of conditions, each is actually a function reference.  Those functions return a boolean, and when considering an attack token, you first process each conditional function in its list and if they are all true, execute the attack. This potentially entirely replaces my AI, because I could have a conditional function list containing [(am I standing next to an aggressor?)(am I less than 10% health?)(is my int>10)] with an 'attack' function of (run away!)

5
Design / Re: Spellcaster AI design
« on: January 29, 2014, 09:03:34 AM »
All my attacks are modular, atomic functions with a weighting.  Each monster maintains a list of attacks ordered by weight and will select the highest weighted attack in their list that suits their current circumstance. I add spells as attacks to a monsters list - for example, a ghoul gains a cast-slow spell every time they eat a corpse.  With a high weighting, the ghoul will always cast slow on its quarry. This removes the cast slow from its list, leaving it with only melee in its attack list after that.  Some spells/attacks are permanent, but have a cooldown, so I remove after use, but use a scheduler to reinsert that attack back into the respective critter's attack_list after the cooldown period.

So that is very deterministic - the AI plays to the best of its ability, including unleashing whatever it has at its disposal. Simply: beware the well fed ghoul.




6
Development Process & non-technical / Gettin it done
« on: January 23, 2014, 10:18:13 PM »
I've been reading a bit recently about game development (Sensible Software is a belter of a bio if their name means something to you) and thinking about my own project. 

I've had an idea for a while and recently stumbled on the tute written by Jotaf (missing, presumed ascended circa-2010),  I haven't really coded since Uni but I managed to quickly wrap my head around the tute and then extended the code to do the things I was interested in. As I went new things occured to me and I was throwing anything in there that I felt was cool. One of the best parts started as a mistake!  There's a lot of rabbit holes to disappear down, and it's clear I'm easily distract-

SQUIRREL!!...

Oh, I'm sorry, what were we talking about?

Anyway I've decided it's time to start again, but something that has an end in sight.  Reading Jo and friends on the Superhero RL thread suggest the benefits of having a mature vision before starting out...a design document of sorts. My organic style meant implementing ideas I had late in the process sometimes required refactoring to accommodate.  Clearly inefficient. So I'm going to do some design on paper first, and see how I go. A bit of bounded scope should also help contain my tendency to wander.

If you've 'finished' a game before, what got you there?

7
Design / Re: Super Hero RL - Design Fail?
« on: January 21, 2014, 08:04:38 AM »
Great concept with loads of promise, Jo. You have enough core concepts sufficiently sketched out to go to prototype.  There you can road test the mechanics and think of new possibilities.

Absolutely do it for yourself, it's one of the best reasons to do anything.  But don't you dare hide this away! I am already salivating to play this game.      :D

8
Design / Re: An old wild west roguelike? Ideas.
« on: November 26, 2013, 09:02:05 PM »
So the tutorial is set up for creating a projects folder in which you create a new file called myroguelike.py (or similar). Then in this folder you also add the following files from the libtcod directory, (direct snippet from the RL tute)

Code: [Select]
Now to create your project's folder. Create an empty file with a name of your choice, like firstrl.py. The easiest way to use libtcod is to copy the following files to your project's folder:

    libtcodpy.py
    libtcod-mingw.dll on Windows, libtcod.so on Linux
    SDL.dll on Windows, SDLlib.so on Linux
    A font from the fonts folder. We chose arial10x10.png.

I think the libtcodpy files are not visible from the CLI compiler you're typing that first command in. I think they could be if you copied those files into the Python27 directory, but they're not that useful there either.

So I suggest: create your project folder (under the python27 directory, mine is Python27\Projects\firstrl.py) copy those files and then start your .py file with the import statement. That works for me anyway!

As a side note the python CLI run-time is great for quickly testing (non-libtcodpy) commands to see what effect/value they produce.

Good luck

9
Design / Re: An old wild west roguelike? Ideas.
« on: November 23, 2013, 11:03:16 PM »
I love this idea, I can really picture an ASCII Red Dead Revolver with permadeath and a dash of the Jurassic.
I'd be tempted to pick it up if I wasn't already a couple of months down my own RL rabbithole

Break out that Python Tutorial and go for it. By the end of that tute you'll have a reasonably comprehensive set of mechanics and it explains what it's doing every step of the way. Well done Jotaf, where-ever you are (presumably ascended).

Coding it is where the idea really begins to solidify - no idea will survive exactly the same once you start implementing it.

Pages: [1]